JSON Parser

Base64 Encoder & Decoder Online

Encode text or JSON to Base64, or decode a Base64 string back to readable text, instantly and without signup. Everything runs in your browser, so tokens, API payloads and config values you paste here are never uploaded. The tool handles UTF-8 (accents, emoji), has a one-click URL-safe switch for Base64url, accepts files, and decodes input with or without = padding.

How to encode and decode Base64

  1. Pick Encode to turn text into Base64, or Decode to turn Base64 back into text.
  2. Paste your text (or click Upload to load a file). The result appears on the right immediately.
  3. Turn on URL-safe if the output will go in a URL, filename or JWT (see below).
  4. Use the swap button between the two panels to feed the output back in as the input, handy for checking a round trip.

What is Base64?

Base64 is a way of writing binary data using only 64 safe, printable characters: A–Z, a–z, 0–9,+ and /. It takes the input three bytes at a time and writes each group as four characters, adding=at the end when the input doesn't divide evenly. That is why Base64 output is always about 33% larger than the original. It exists so that binary or special-character data can travel through systems that only handle plain text, such as JSON, email, HTML and URLs. For a deeper walkthrough, read What is Base64 encoding and when should you use it.

Base64 examples

TextBase64Base64url (URL-safe)
HelloSGVsbG8=SGVsbG8
Hello, World!SGVsbG8sIFdvcmxkIQ==SGVsbG8sIFdvcmxkIQ
{"user":"alice"}eyJ1c2VyIjoiYWxpY2UifQ==eyJ1c2VyIjoiYWxpY2UifQ
subjects?_d>>c3ViamVjdHM/X2Q+Pg==c3ViamVjdHM_X2Q-Pg
José 🚀Sm9zw6kg8J+agA==Sm9zw6kg8J-agA

The fourth row shows why the two variants exist: standard Base64 uses + and /, which have special meaning in URLs, while Base64url swaps them for - and _ and drops the padding.

Standard Base64 vs URL-safe Base64 (Base64url)

Use standard Base64 for email, data URIs and most APIs. Use Base64url whenever the value will appear in a URL, a query string or a filename, and in the parts of a JWT: it replaces + with -, / with _ and removes the trailing =. When decoding, this tool accepts both forms and adds missing padding for you. To read the header and payload of a token, use the JWT decoder.

Common Base64 questions

  • Is Base64 encryption? No. Anyone can decode it, so never use it to protect secrets. It only changes how data is written.
  • Why does my Base64 end with = or ==? That is padding, used when the input length isn't a multiple of three bytes.
  • Why do I get "Invalid input for decoding"? The string contains characters outside the Base64 alphabet (spaces inside the string, stray quotes), is truncated, or decodes to binary rather than text.
  • Does it support Unicode? Yes. Text is encoded as UTF-8 first, so accents and emoji round-trip correctly.
  • How do I Base64-encode JSON? Paste the JSON as text and encode it. Format it first with the JSON parser if you want to control whitespace.

Related tools

Percent-encode query values with URL Encode / Decode, escape special characters in strings with JSON Escape, or create fingerprints with the hash generator.

Handles JSON files up to 20MB smoothly