Hack the Hydra

Base64 encode and decode

Convert text to Base64 and back. Unicode text (accents, emoji, any language) is encoded as UTF-8, so the result matches what servers and other tools expect. Nothing leaves your browser.

🔒 Private by design: the conversion runs in this browser tab. Nothing is uploaded.

Base64 encode and decode is a free online tool by Hack the Hydra. Encode text to Base64 or decode Base64 to text online. Handles UTF-8, accents and emoji correctly; URL-safe option. Private, runs in your browser.

100% freeNo upload: runs in your browserNo sign-up
Base64 encode and decode: the tool with a sample file converted

Why UTF-8 matters

The browser's built-in btoa() function fails on any character outside Latin-1, and decoding with atob() alone gives garbled text for accents. This tool first converts your text to UTF-8 bytes and then to Base64 (and the reverse), so "héllo ✓" round-trips exactly and matches the output of command-line tools such as base64 on Linux or macOS.

URL-safe Base64

Standard Base64 uses + and / and ends with = padding, which are awkward in URLs and file names. The URL-safe variant used by JWTs replaces them with - and _ and drops the padding. Tick the option when encoding; decoding accepts both variants automatically and ignores spaces and line breaks.

Base64 is not encryption

Base64 only changes how bytes are written, it hides nothing. Anyone can decode it. Never use it to protect passwords or secrets; use real encryption for that. It is useful for embedding small data in text formats such as JSON, HTML, email and data: URLs, at the cost of about 33% more size.

Example

Encoding a short text to Base64.

Input

Hello, world!

Output

SGVsbG8sIHdvcmxkIQ==

How to use

  1. Type or paste your text in the box above.
  2. The result updates as you type; change the options to switch mode.
  3. Copy the result or download it.

FAQ

Is my data uploaded?

No. Encoding and decoding are done by JavaScript in your browser.

Why does decoding say the bytes are not valid UTF-8?

The Base64 is valid but it represents binary data, such as an image or a file, rather than text. This tool works with text only.

Can I decode a JWT with this?

You can paste one segment (header or payload) of a JWT to read its JSON; the segments are URL-safe Base64 and are accepted without padding. The signature is not verified.

Does it add line breaks?

No. The output is one continuous line, which is what most APIs expect.

Guides

More free converters

PDF to Markdown converterOCR PDF: scanned PDF to textImage to text (OCR)Word (DOCX) to Markdown converterExcel & CSV to Markdown tablesHTML to Markdown converterPowerPoint (PPTX) to Markdown converterJSON to Markdown tablePDF to text converterExcel to JSON converterMarkdown to HTML converterMerge PDF filesSplit PDF: extract pagesRotate PDFJPG to PDF converterPDF to JPG converterImage converter: PNG, JPG, WebPCompress image: JPG and WebPQR code generatorWord counterCase converterJSON formatter and validatorURL encoder and decoderUUID v4 generatorStrong password generatorLorem ipsum generatorJSON to CSV converterRemove duplicate linesUnix timestamp converterJSON to YAML converterText diff checkerImage resizerPercentage calculatorAge calculatorHash generator (SHA-256, SHA-1, SHA-512)Color converter: HEX, RGB, HSLDays between dates calculatorYAML to JSON converterUnit converterJWT decoderBinary, hex, decimal and octal converterRoman numeral converterRegex testerCron expression explainerPDF to Markdown for ChatGPTPDF to Markdown for ClaudePDF to Markdown for RAG pipelinesPDF to Markdown for ObsidianPDF to Notion (via Markdown)Screenshot to textFrench OCR: image to textCSV to Markdown tableGoogle Docs to MarkdownJPG / JPEG to text (OCR)PNG to text (OCR)CSV to JSON converterPNG to JPG converterJPG to PNG converterWebP to PNG converter