JSON to Base64
Encode a JSON payload as Base64 so it can travel safely inside a token, a data URI or a query string.
Your data stays on your device
Input — JSON
- characters
- 0
- lines
- 0
- size
- 0 B
Output — Base64
- characters
- 0
- lines
- 0
- size
- 0 B
Options
About this tool
Base64 turns bytes into a compact set of URL- and header-friendly characters. Encoding JSON this way is common for JWT-style payloads, signed cookies, data URIs and anywhere raw braces and quotes would need escaping.
The tool validates your JSON first so you never encode a broken document. You can minify before encoding to keep the output short, and switch to the URL-safe alphabet used by tokens and query strings.
How to use this tool
- Paste the JSON you want to encode, or upload a file.
- Choose whether to minify first and whether to use the URL-safe alphabet.
- Press Encode to produce the Base64 string.
- Copy it into your token, header or URL, and decode later with Base64 to JSON.
Key features
- Validates the JSON before encoding
- Optional minify-before-encode for shorter output
- Standard or URL-safe Base64 alphabet
- UTF-8 correct for non-ASCII content
- Reversible with Base64 to JSON
Example
Input — JSON
{"id":42,"ok":true}Output — Base64
eyJpZCI6NDIsIm9rIjp0cnVlfQ==Good to know
- Base64 is encoding, not encryption. Anyone can decode it, so never treat it as a way to hide secrets.
- The encoded form is about a third larger than the JSON it represents.
Frequently asked questions
When should I use the URL-safe alphabet?
When the Base64 will appear in a URL or a JWT, where + and / are replaced by - and _ to avoid escaping.
Does Base64 keep my JSON private?
No. It is trivially reversible. Use it for transport, not for secrecy.
Is the JSON uploaded?
No. Encoding happens in your browser.
Your data stays on your device
Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.