vasilenko.info

Base64 encoding

/en/tool/base64/ works Encoded in the browser

Paste a string, drag a file onto the panel, or paste an image from the clipboard — the tool converts data to and from Base64. You can save decoded data as a file: the type is detected from the first bytes, and images and PDFs are displayed right away. It understands JWT, email headers such as =?windows-1251?B?…?=, and supports hex, Base32, and percent encoding in addition to Base64. Nothing is sent anywhere: everything runs in the browser.

promoTwenty years of notes on websitesHow we did it in 2008 and what still works today.Open

Encoding and decoding

A file can be dragged anywhere on the panel, and an image from a screenshot tool can be pasted with Ctrl+V.

What to do
Into

Text encoding

Encoding applies only to text: a file is already a set of bytes, so it is not affected. The browser parses ISO-8859-1 using the windows-1252 table—as required by the standard—so bytes 80–9F produce typographic quotes and dashes instead of empty space.

Result format

Drag a file here—or press Ctrl+V to paste an image from the clipboard

Result

base64

Done

    Input bytes
    Output characters
    Size increase
    Lines in result

    Processed by the browser. Neither text nor files are sent anywhere: after loading, the page makes no requests at all—you can see this in the developer tools. Settings and short text remain in the address bar, so you can share the analysis link.

    promoCalculate ROI at the same timeCampaign payback based on spend and revenue.Open

    How to use it

    1. Choose a mode. “Encode” converts text or a file to Base64; “Decode” converts it back. You do not have to find the file in Explorer: you can drop it onto the panel, or paste an image from a screenshot tool with Ctrl+V.

    2. The “Convert to” row switches the result alphabet without changing the input: Base64, Base64 for URLs, hex, Base32, and percent encoding are all calculated from the same bytes. During decoding, the same row specifies what to decode.

    3. The decoded result is not necessarily text. If the first bytes identify an image, PDF, or audio file, the tool names the format, displays it right on the page, and offers to save it with the correct extension.

    4. If the bytes do not form valid UTF-8, the tool tries windows-1251, KOI8-R, and CP866 and suggests the one that produces readable Cyrillic text. You can switch to it with one click.

    5. You do not need to decode a JWT string or an email header such as =?windows-1251?B?…= separately: the tool recognizes them automatically and shows their parts.

    6. The “String check” block works before any decoding: length, divisibility by four, alphabet, padding, and the resulting byte count. It shows whether the string is truncated or complete.

    promoBrowser task listNo account required—everything is stored on your device.Open

    The formula and what it includes

    Base64 characters = 4 × ⌈Bytes ÷ 3⌉

    That is why the increase is always one-third: three bytes of data become four characters. hex doubles the size exactly; Base32 increases it by half; the increase from percent encoding depends on the data: Latin letters and digits stay as they are, while everything else triples in size. Base64 is not encryption or compression, but a way to carry binary data through a text-based channel.

    Example breakdown: the word “Привет”

    The input data is the same as the default field values: you can calculate it mentally and confirm that the tool is telling the truth.

    1. Each of the six Cyrillic letters takes two bytes in UTF-8. That makes 12 bytes in total.

    2. 12 is evenly divisible by 3, so there are exactly four groups and no equals signs are needed at the end.

    3. Output characters: 4 × (12 ÷ 3) = 16.

    4. Increase: (16 − 12) ÷ 12 = 33%.

    The result is 0J\/RgNC40LLQtdGC — 16 characters versus 12 bytes. With the URL-safe alphabet, the slash is replaced with an underscore: 0J_RgNC40LLQtdGC. If you switch the encoding to windows-1251, the same six letters take 6 bytes, and the string is half as long — 8 characters.

    Frequently asked questions

    promoAll toolsForty-four tools, all running in your browser.Open

    Related tools

    6

    MD5 and SHA hashes

    Calculates MD5, SHA-1, SHA-256, and SHA-512 hashes for a string or file.

    Open

    Password generator

    Creates passwords of the required length and assesses how difficult they are to crack.

    Open

    Timestamp converter

    Converts Unix time to a date and back, taking the time zone into account.

    Open