Base64 Encoder
Encode text or files to Base64 — standard or URL-safe — in your browser.
The Base64 Encoder converts text — or a whole file — into Base64, the ASCII-safe encoding used for embedding data in JSON, XML, emails and URLs. Type or paste text and the encoded result appears instantly, with a URL-safe (Base64url) mode for values that travel in query strings and JWTs.
Base64 represents binary or exotic text using only A–Z, a–z, 0–9, +, / and =, which is why it survives systems that expect plain ASCII. This encoder is Unicode-safe: emoji, accented characters and non-Latin scripts are converted to UTF-8 bytes first, avoiding the garbled output naive encoders produce.
You can also pick a file from your device — it is read locally and encoded in your browser without any upload. The file Base64 output is handy for embedding small assets or testing data-URI workflows.
Encode a file to Base64 (no upload — read in your browser)
How to use the Base64 Encoder
- Type or paste the text you want to encode.
- Tick 'URL-safe' if the output must avoid + / = characters.
- Copy the encoded result.
- Or choose a file to encode it to Base64 without uploading.
- Paste the output into JSON, email or your code.
Frequently asked questions
Why does Base64 end with = signs sometimes?
Base64 encodes bytes in groups of three into four characters. If the input is not a multiple of three bytes, padding is added as one or two '=' characters. URL-safe mode strips this padding, which is why Base64url values can omit it.
What is the difference between Base64 and Base64url?
Standard Base64 uses + and /, which have special meaning in URLs. Base64url replaces them with - and _ and drops padding, producing values safe for query strings, cookies and JWT segments. Toggle the checkbox to switch.
Is encoding the same as encryption?
No — Base64 is reversible encoding, not security. Anyone can decode it instantly (see the Base64 Decoder). Never use Base64 to protect sensitive data; use real encryption.
Related tools
View all developer tools →JSON Formatter & Validator
Format, minify and validate JSON instantly with clear error messages that point at the exact problem.
Dev ToolsJSON Validator
Check if your JSON is valid and find syntax errors with exact line and column.
Dev ToolsJSON Minifier
Compress JSON to its smallest valid form for storage and transport.
Dev ToolsJSON to CSV
Convert a JSON array of objects into a clean CSV file in one click.
Dev ToolsCSV to JSON
Convert CSV (from Excel or Google Sheets) into a JSON array of objects.
Dev ToolsBase64 Decoder
Decode Base64 back to readable text — UTF-8 safe, instant and private.