All tools
SEO Tools
Ads Tools
Link Tools
Social Tools
Text & Content Tools
Utilities
Finance Calculators
Thai Business
Image & Media Tools
Numerology & Fortune
Home & Living
Education
Health

Base64 & Data URI Converter

Encode text to Base64 and decode it back, convert any image or file into a data: URI you can paste straight into CSS or HTML, and decode data URIs to inspect their MIME type, size and preview. Encoding is UTF-8 safe, so Thai characters and emoji survive the round trip, and a URL-safe alphabet is one click away. Everything runs locally in your browser — your text and files are never uploaded.

Direction

Uses - and _ instead of + and / and drops the = padding — safe inside a URL or filename.

Encodes UTF-8 correctly, so Thai text and emoji never break.

The result will appear here

Encode or decode text, turn a file into a data URI, or decode one you paste in.

How to use

  1. Open the "Text ↔ Base64" tab and type or paste your content — auto-detect handles the direction.
  2. For files, switch to "File → Data URI" and choose an image to get its data: URI and a live preview.
  3. To inspect an existing data URI, use the "Data URI → decode" tab and paste it in.
  4. Toggle "URL-safe alphabet" when the Base64 must sit inside a URL or filename.
  5. Click Copy to grab the result, or Swap to reverse a text conversion.

Features

  • UTF-8-safe encoding — Thai text and emoji never break
  • Auto-detect encode vs decode, or set the direction explicitly
  • URL-safe Base64 (- and _ with no padding) on demand
  • Image or file to data: URI with instant preview and byte size
  • Decode any data URI to see its MIME type, size and image preview
  • 100% client-side — nothing is uploaded to a server

Frequently asked questions

Does it handle Thai text and emoji correctly?
Yes. Text is encoded through TextEncoder as real UTF-8 bytes before Base64, so Thai characters, combining vowels and emoji all round-trip perfectly. A naive btoa() would corrupt them — this tool does not.
What is a data URI and when would I use one?
A data: URI embeds a file — often a small image — directly inside your HTML or CSS as Base64 text, so the browser needs no extra request. It is handy for tiny icons, email templates and inline SVGs. This tool builds one from any image and can decode one back.
What does "URL-safe alphabet" do?
Standard Base64 uses + and / and = padding, which can break inside URLs or filenames. URL-safe mode swaps them for - and _ and removes the padding, following the RFC 4648 URL and filename-safe alphabet. Decoding accepts either form.
Are my files or text uploaded anywhere?
No. All encoding, decoding and file reading happen in your browser with JavaScript and the FileReader API. Nothing leaves your device, which makes it safe for confidential images and text.
Why do I get an "invalid Base64" error?
The input contains characters outside the Base64 alphabet, has a length that cannot be valid, or decodes to bytes that are not valid UTF-8 text. Check for stray spaces, missing padding, or that you picked the right URL-safe setting.