Home Explore Blog CI



nushell

commands/docs/encode_base64.md
6fbb805f50f26918ec759b997f9006c1562f4434cd3c2af60000000300000478
---
title: encode base64
categories: |
  formats
version: 0.104.0
formats: |
  Encode a string or binary value using Base64.
usage: |
  Encode a string or binary value using Base64.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `encode base64` for [formats](/commands/categories/formats.md)

<div class='command-title'>Encode a string or binary value using Base64.</div>

## Signature

```> encode base64 {flags} ```

## Flags

 -  `--url`: Use the URL-safe Base64 version.
 -  `--nopad`: Don't pad the output.


## Input/output types:

| input  | output |
| ------ | ------ |
| binary | string |
| string | string |
## Examples

Encode a string with Base64
```nu
> "Alphabet from A to Z" | encode base64
QWxwaGFiZXQgZnJvbSBBIHRvIFo=
```

Encode arbitrary data
```nu
> 0x[BE EE FF] | encode base64
vu7/
```

Use a URL-safe alphabet
```nu
> 0x[BE EE FF] | encode base64 --url
vu7_
```

## Notes
The default alphabet is taken from RFC 4648, section 4.  A URL-safe version is available.

Note this command will collect stream input.

Chunks
bb8dfc20 (1st chunk of `commands/docs/encode_base64.md`)
Title: encode base64
Summary
The `encode base64` command encodes a string or binary value using Base64 encoding. It supports URL-safe Base64 encoding and can omit padding. It accepts string or binary input and outputs a Base64-encoded string.