Skip to content
DN
Esc
  • JSON FormatterBeautify, minify and validate JSON instantly as you type.
  • Base64 Encoder/DecoderConvert text to Base64 and back, with full Unicode support.
  • UUID GeneratorGenerate random v4 UUIDs — one or many — in the format you need.
  • JWT DecoderDecode JSON Web Tokens to inspect the header, payload and expiry.
  • Timestamp ConverterConvert Unix timestamps to dates and dates to timestamps.
  • URL Encoder/DecoderPercent-encode and decode URLs, and break down query strings.
  • Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.
  • Regex TesterTest regular expressions with live match highlighting and groups.

↑ ↓ to moveEnter to openPaste data to open it in the right tool. Nothing leaves your browser.

Base64 Encoder & Decoder

Convert text to Base64 and Base64 back to text as you type. Unicode-safe, with a URL-safe option — and nothing leaves your browser.

Last updated

Plain text

Base64

The result appears here as you type

How to use the Base64 Encoder/Decoder

  1. Pick a direction

    Choose Encode → Base64 to encode text, or Decode → Text to decode Base64.

  2. Enter your input

    Type or paste into the input panel — the result appears instantly.

  3. Adjust options

    Turn on URL-safe mode to get output that's safe to use in URLs and file names.

  4. Copy, download or swap

    Copy or download the result, or use the swap button to reverse the conversion.

Features

  • Live encoding and decoding as you type
  • Full UTF-8 support, including accented letters, non-Latin scripts and emoji
  • Optional URL-safe output (- and _ instead of + and /, without = padding)
  • Forgiving decoder: accepts URL-safe Base64, ignores spaces and line breaks, and adds missing padding
  • A clear error when the decoded data is binary rather than text
  • Swap button to reverse the conversion; copy, download as .txt, or paste from your clipboard
  • Decoded output that contains JSON, a JWT or a timestamp can be opened in the matching tool
  • Character and byte counts for input and output
  • Keyboard shortcuts: Ctrl/Cmd + Enter copies the result, Ctrl/Cmd + S downloads it

Is my data sent anywhere?

No. Encoding and decoding use your browser's built-in TextEncoder, TextDecoder, btoa and atob functions. Your text never leaves your device and isn't stored.

Read the DevNest privacy policy

Examples

  • Encode text to Base64

    Choose Encode → Base64 and type your text.

    Text

    Hello, DevNest!

    Base64

    SGVsbG8sIERldk5lc3Qh
  • Decode Base64 to JSON

    Decoded output that contains JSON can be opened straight in the JSON Formatter.

    Base64

    eyJ1c2VyIjoiYWRhIiwicm9sZSI6ImFkbWluIn0=

    Text

    {"user":"ada","role":"admin"}
  • Encode Unicode and emoji

    Text is encoded as UTF-8 first, so accents and emoji round-trip correctly.

    Text

    café ☕

    Base64

    Y2Fmw6kg4piV

Understanding Base64

What is Base64?

Base64 represents any data using 64 printable characters — A–Z, a–z, 0–9, + and / — with = as padding. Every 3 bytes of input become 4 characters. It's used wherever only text is allowed: data URLs, JSON payloads, email attachments, HTTP Basic authentication headers and JSON Web Tokens.

Hi!      →  SGkh
DevNest  →  RGV2TmVzdA==

Base64 encoding vs encryption

Base64 is an encoding, not encryption. There's no key and no secret: anyone can decode Base64 instantly, so it provides no confidentiality at all. Never use it to hide passwords, API keys or personal data. If data needs to be protected, encrypt it with a proper algorithm such as AES — and store passwords with a password hashing algorithm, not Base64.

Encoding and decoding step by step

  • To encode: select Encode → Base64 and type or paste your text. Turn on URL-safe if the result will go in a URL or file name.
  • To decode: select Decode → Text and paste the Base64. Standard and URL-safe Base64 both work, and line breaks are ignored.
  • To check a round trip: click the swap button — the result becomes the new input and the direction reverses.

Unicode and emoji support

The browser's built-in btoa() only handles Latin-1 characters and throws an error on text like café or emoji. DevNest first converts your text to UTF-8 bytes and then encodes those bytes, so text in any language round-trips correctly. When decoding, the bytes are strictly checked as UTF-8, so binary data is reported instead of being shown as garbled characters.

café  →  Y2Fmw6k=

URL-safe Base64

In URLs, + and / have special meanings and = often needs escaping. URL-safe Base64 (also called Base64URL, defined in RFC 4648) replaces + with - and / with _, and usually drops the = padding. JSON Web Tokens use this variant.

Bytes FB FF
Standard:  +/8=
URL-safe:  -_8

Frequently asked questions

Why is Base64 output larger than the input?

Base64 uses 4 characters to represent every 3 bytes of data, so encoded output is about 33% larger than the original.

Why does decoding say the data is not valid UTF-8 text?

The Base64 decoded successfully, but the bytes aren't readable text. This usually means it represents binary data such as an image, a PDF or a compressed file.

Can I decode Base64 without = padding?

Yes. Missing padding is added automatically, and spaces and line breaks are ignored.

What's the difference between Base64 and Base64URL?

Base64URL is the URL-safe variant: it uses - and _ instead of + and /, and usually has no = padding. The decoder accepts both; turn on URL-safe to produce Base64URL output.

Can I encode files or images?

No. This tool converts text. It's designed for strings such as tokens, headers and configuration values.