mockstack.

Base64, URLs, HTML entities, and JSON strings, with correct Unicode handling.

Input
Output
Live · Converts as you type Also on the menuJWT DecoderHash GeneratorUUID Generator

About the Base64 and URL Encoder

Updated

Encodes and decodes base64, URLs, HTML entities, and JSON strings, in your browser.

Every Setting

Encoding
Base64 turns text or any file into plain characters and back. URL percent-encodes text so it can travel in a web address. HTML Entities escapes text so a page shows it instead of reading it as markup. JSON String escapes text so it fits inside quotes in JSON.
Direction
Encode or Decode. Paste something that already looks encoded while encoding, and a switch offers to decode it instead.
Each Line Separately
Treats every line as its own value, for a list of tokens, links, or names. Without it the whole box is one value, line breaks included.
Variant
Base64 only. Standard is the common form. URL Safe swaps the two characters that break inside web addresses (+ and /) for - and _, which is what tokens and links expect.
Padding
The trailing = signs that square the output length. Some systems demand them, some reject them; the toggle writes both forms.
Wrap at 76
Breaks the output into 76-character lines, the format email attachments and some configs expect.
Encode a File
Reads the file’s real bytes, so accents, emoji, and binary data survive the round trip exactly.
Output As
Base64 alone, a Data URI with the file’s type, or for images a CSS background-image line or an HTML img tag with the width and height filled in.
Component or Whole URL
Component encodes every character with a meaning in a URL, right for a single query value or path segment. Whole URL leaves : / ? # & and = alone, so a full address stays a working address. Spaces as + writes spaces the way HTML forms send them, and reads + back as a space when decoding.
Markup Characters or Also Non-ASCII
Markup Characters escapes only what HTML would misread. Also Non-ASCII turns accents and emoji into numbered entities as well, for systems that only take plain ASCII.
Wrap in Quotes
Adds the surrounding double quotes to an escaped JSON string.
Input
Swap moves the output back into the input for chained conversions; Clear resets the page.
Output
Download writes decoded bytes to a file with the right extension, told from its contents; decoded images preview under the box.
Pane Divider
Remembers your split. Double-click the bar to reset it.
Cheat Sheet
Data-URI prefixes to insert, plus what the padding signs and the URL-safe characters mean.

Common Questions

Is base64 encryption?
No. It is a reversible encoding anyone can decode. Never treat it as protection.
Why is base64 bigger than the original?
The format spends four characters per three bytes, about a third larger by design.
How do I turn an image into base64 for CSS?
Choose Encode a File, pick the image, and set Output As to CSS. The result is a background-image line you can paste into a stylesheet.
Should I use Component or Whole URL?
Component for one piece, like a search term going into ?q=. Whole URL for an entire address that has spaces or accents in it.

Related: JWT Decoder, Hash Generator, JSON Formatter.