Encode / Decode

Base64, URL encoding, HTML entities, JSON strings, hex and Unix timestamps. Results update as you type, and nothing leaves your browser.

Input
Output

What each conversion is for

ConversionTypical useExample
Base64Binary data in JSON, email attachments, Basic auth headersHello → SGVsbG8=
Base64URLJWTs and values that go into URLs<<? → PDw_
URLQuery string values and path segmentsa b&c → a%20b%26c
HTML entitiesShowing user text safely inside HTML<b> → &lt;b&gt;
JSON stringPutting text inside a JSON value, or reading an escaped payload from a logline "1" → "line \"1\""
HexLooking at raw bytes, hashes and binary protocolsHi → 4869
Unix timestampReading created_at values, JWT exp claims and log times1700000000 → 2023-11-14T22:13:20Z

Unicode works properly

JavaScript's built-in btoa() fails on text like café or emoji. This tool converts text to UTF-8 bytes first, so every character round-trips correctly and the Base64 matches what Java, Python and most servers produce.

Unescaping JSON from logs

Logs and message queues often store a JSON payload as an escaped string, full of \" and \n. Choose JSON string and Decode to turn it back into readable JSON. If the result is JSON itself, it is formatted for you.

Decoding files

When Base64 or hex decodes to something that isn't text, such as an image or a zip archive, you'll see the bytes as hex, a hint about the file type, and a Download button. Going the other way, File to Base64 encodes any file up to 10 MB without uploading it.

Frequently asked questions

Is Base64 encryption?

No. Base64 only changes how bytes are written so they survive systems that expect text. Anyone can decode it, so it gives no protection to passwords or other secrets.

What's the difference between Base64 and Base64URL?

Base64URL uses - and _ instead of + and / and usually drops the = padding, so the result can go into URLs and file names without escaping. JWTs use Base64URL. The decoder here accepts both.

Why does decoding show hex instead of text?

The decoded bytes aren't readable UTF-8 text, for example an image or a zip file. The tool shows them as hex, tells you what kind of file they look like, and lets you download them.

Is the timestamp in seconds or milliseconds?

It's detected from the number of digits: up to 11 digits is read as seconds, 12 to 13 as milliseconds, and longer numbers as microseconds or nanoseconds. The result says which one was used.