Base64 Encoder & Decoder
Encode text to Base64 or decode it back, UTF-8 safe: standard and URL-safe alphabets, padding control, file-to-Base64, and data-URI decoding, all in your browser.
Your result will appear here.
Input: 0 characters / 0 bytes
File is read locally in your browser and never uploaded.
🔒 Privacy: conversion runs locally in your browser. Base64 is encoding, not encryption: anyone can decode it, so never use it to hide a password or API key.
More developer tools
How this calculator works
Base64 turns any bytes into plain ASCII text so binary data can travel through systems that only handle text: JSON payloads, email attachments, data URIs, JWT tokens and config files. This tool encodes text to Base64 and decodes Base64 back to text, entirely in your browser. Paste a string, pick Encode or Decode, and copy the result. A file mode encodes any local file to its Base64 string, and pasting a data URI decodes just the payload part after the comma.
The detail that breaks most quick tools is character encoding. Naive encoders built on the old btoa function corrupt anything outside Latin-1: emoji, accented letters and non-English scripts come back mangled. This tool converts text to real UTF-8 bytes first, so Hindi, Spanish accents and emoji round-trip exactly. Worked example: the word Authgear encodes to QXV0aGdlYXI=, and the Hindi word नमस्ते encodes to 4KSo4KSu4KS44KWN4KSk4KWH. Decoding accepts strings with or without the trailing = padding, and the URL-safe variant swaps + for - and / for _, which is the alphabet JWTs and OAuth tokens use.
One honest warning belongs on every Base64 page: Base64 is not encryption. Anyone can decode a Base64 string in a second, so never use it to hide a password, API key or secret. Its job is transport, not secrecy. For tokens and API payloads you are debugging, the in-browser design matters: nothing you paste is uploaded, so inspecting a suspicious Base64 payload from a log or email stays private to your machine.
