OnlineFreeTools.org
  • Home
  • Image editing tools
    • Add Text Watermark to Photo — Local Browser Tool
    • Extract Colors from Image — Palette & Click Pick
    • Flip Image — Mirror Horizontally or Vertically
    • Add Border to Image — Color & Width Online
    • Image Compressor — Resize, Quality & Target Size Local
    • Crop & Resize Image — Local Aspect Presets
    • Photo EXIF Viewer & Remover — GPS, Camera & Local Strip
    • Image Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVG
    • Convert Image to Grayscale — Black & White Online
    • Merge Images — Combine Photos into One Collage
    • Image Optimizer — WebP, AVIF & MozJPEG Local
    • Overlay Images — Put a Logo on a Photo
    • Image to Base64 Converter — Encode & Decode Locally
    • Images to GIF — Make an Animated GIF Locally
    • Images to PDF — Combine Photos into One File
    • Images to PowerPoint — Photos to PPTX Slides
    • Images to Word — Build a DOCX from Photos
    • PDF Page to Image Sizes — Multi-Size Export Pack
    • PDF to JPG — Convert Pages to Images in Your Browser
  • Design tools
    • Generate Brand Color Scale — 50–950 Palette & CSS Tokens
    • Brand Style Guide — Generate a Modular Draft You Can Edit
    • Smart Website Color Scheme — Semantic CSS Tokens
    • WCAG Contrast Checker — AA/AAA Ratio Online
  • PDF tools
    • Compress PDF — Shrink File Size in Your Browser
    • Crop PDF — Trim Page Margins in Your Browser
    • Merge PDF — Combine Files in Your Browser
    • Organize PDF — Reorder or Remove Pages in Your Browser
    • Add Page Numbers to PDF — In Your Browser
    • PDF to Markdown — Extract Text for Notes in Your Browser
    • PDF Watermark — Stamp Text on Every Page in Your Browser
    • Protect PDF — Password-Encrypt in Your Browser
    • Rotate PDF — Fix Page Orientation in Your Browser
    • Split PDF — Extract Pages Locally
    • Unlock PDF — Remove Password You Already Know
  • Developer tools
    • Add WWW to DNS — A/CNAME, Apex Rules & Provider Guides
    • Base64 Encode & Decode — Convert Text in Your Browser
    • CSV ↔ JSON Converter — Types, Delimiters & Local
    • Domain Lookup — Check DNS Records & Registration Online
    • File Hash Checker — Verify Digests in Your Browser
    • HTML Entity Encoder & Decoder — Escape, Unescape & Local
    • IndexNow — Bing URL Submit, Key Check & Status Codes
    • What Is My IP Address — See Your Public IP (IPv4 or IPv6)
    • JSON Schema Validator — Draft-07 Paths & Local
    • JWT Decoder — Read Header & Payload Locally (No Verify)
    • Markdown ↔ HTML Converter — Sanitize & Preview
    • Random Password Generator — Create Passwords Locally
    • Compare Two Texts Online — Text Diff Checker
    • Time Zone Converter — Compare One Moment Worldwide
    • Unix Timestamp Converter — Epoch ↔ Readable Time
    • UUID & ULID Generator — Create IDs in Your Browser
    • Check HTTP Response Headers Online
    • YAML ↔ JSON Converter — Types, Multi-doc & Local
  • Calculators
    • BMI Calculator — How to Calculate Body Mass Index
    • Gradient Calculator — Multivariable ∇f (Partial Derivatives)
    • How to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)
    • Percentage Change Calculator — From Old Value to New
    • ROI Calculator — How to Calculate Return on Investment
    • Square Feet to Square Meters — Area Converter for Homes & Renovation
  • English
  • 中文
  • Español
  • العربية
  • Português
  • Bahasa Indonesia
  • Français
  • 日本語
  • Русский
  • Deutsch

Tools

Add Text Watermark to Photo — Local Browser ToolAdd WWW to DNS — A/CNAME, Apex Rules & Provider GuidesBase64 Encode & Decode — Convert Text in Your BrowserGenerate Brand Color Scale — 50–950 Palette & CSS TokensBrand Style Guide — Generate a Modular Draft You Can EditExtract Colors from Image — Palette & Click PickCompress PDF — Shrink File Size in Your BrowserCrop PDF — Trim Page Margins in Your BrowserCSV ↔ JSON Converter — Types, Delimiters & LocalDomain Lookup — Check DNS Records & Registration OnlineFile Hash Checker — Verify Digests in Your BrowserFlip Image — Mirror Horizontally or VerticallyBMI Calculator — How to Calculate Body Mass IndexGradient Calculator — Multivariable ∇f (Partial Derivatives)How to Calculate Marginal Revenue — MR Calculator (ΔTR / ΔQ)Percentage Change Calculator — From Old Value to NewROI Calculator — How to Calculate Return on InvestmentHTML Entity Encoder & Decoder — Escape, Unescape & LocalAdd Border to Image — Color & Width OnlineImage Compressor — Resize, Quality & Target Size LocalCrop & Resize Image — Local Aspect PresetsPhoto EXIF Viewer & Remover — GPS, Camera & Local StripImage Format Converter — PNG JPEG WebP AVIF BMP GIF ICO SVGConvert Image to Grayscale — Black & White OnlineMerge Images — Combine Photos into One CollageImage Optimizer — WebP, AVIF & MozJPEG LocalOverlay Images — Put a Logo on a PhotoImage to Base64 Converter — Encode & Decode LocallyImages to GIF — Make an Animated GIF LocallyImages to PDF — Combine Photos into One FileImages to PowerPoint — Photos to PPTX SlidesImages to Word — Build a DOCX from PhotosIndexNow — Bing URL Submit, Key Check & Status CodesWhat Is My IP Address — See Your Public IP (IPv4 or IPv6)JSON Schema Validator — Draft-07 Paths & LocalJWT Decoder — Read Header & Payload Locally (No Verify)Markdown ↔ HTML Converter — Sanitize & PreviewMerge PDF — Combine Files in Your BrowserOrganize PDF — Reorder or Remove Pages in Your BrowserRandom Password Generator — Create Passwords LocallyAdd Page Numbers to PDF — In Your BrowserPDF Page to Image Sizes — Multi-Size Export PackPDF to JPG — Convert Pages to Images in Your BrowserPDF to Markdown — Extract Text for Notes in Your BrowserPDF Watermark — Stamp Text on Every Page in Your BrowserProtect PDF — Password-Encrypt in Your BrowserRotate PDF — Fix Page Orientation in Your BrowserSmart Website Color Scheme — Semantic CSS TokensSplit PDF — Extract Pages LocallySquare Feet to Square Meters — Area Converter for Homes & RenovationCompare Two Texts Online — Text Diff CheckerTime Zone Converter — Compare One Moment WorldwideUnix Timestamp Converter — Epoch ↔ Readable TimeUnlock PDF — Remove Password You Already KnowUUID & ULID Generator — Create IDs in Your BrowserWCAG Contrast Checker — AA/AAA Ratio OnlineCheck HTTP Response Headers OnlineYAML ↔ JSON Converter — Types, Multi-doc & Local

Base64 Encode & Decode — Convert Text in Your Browser

Convert text or file bytes to Base64 and back in your browser. Steps: pick Encode or Decode, paste text or choose a file, toggle Base64url if needed, then copy. Example: Hello 世界 → SGVsbG8g5LiW55WM. Handles Unicode via UTF-8; nothing is uploaded.


      

How it works

Choose Encode to turn UTF-8 text or file bytes into Base64, or Decode to reverse it. Unicode is handled via UTF-8 bytes before btoa. Enable Base64url for JWT-style output (- and _ instead of + and /, no padding). File input reads bytes locally — no upload.

Rules you should expect

What to expect when encoding or decoding: alphabet variants, UTF-8 handling, padding, and file vs text input.

  • Standard Base64 alphabet: A–Z, a–z, 0–9, +, /. Output length is a multiple of 4 with = padding as needed. Base64url swaps +→- and /→_ and often omits =.
  • Text is always UTF-8 encoded before Base64. One Unicode character may become several Base64 characters (e.g. 世界). Decoding restores the original string when input is valid.
  • File encode reads raw bytes — useful for checksums, attachments, or binary blobs. Text encode and file encode share the same output panel; file mode clears the text area and shows a file info banner.
  • Privacy: no server upload. This tool uses zero external libraries — conversion stays entirely in the browser per RFC 4648.

Example

Encode (standard): Hello 世界 → SGVsbG8g5LiW55WM. Encode (Base64url): same bytes → SGVsbG8g5LiW55WM (no +/=). Decode reverses either form back to Hello 世界.

Good fits

  • Developers: encode JSON or UTF-8 strings for API bodies, data URLs, or test fixtures.
  • JWT / OAuth: produce or inspect Base64url segments before pasting into a JWT decoder.
  • Config / DevOps: embed small binary blobs or secrets as Base64 in YAML, env files, or CI variables.

Frequently asked questions

What is the difference between Base64 and Base64url?

Standard Base64 uses A–Z, a–z, 0–9, +, /, and = padding. Base64url (RFC 4648 §5) replaces + with - and / with _ and usually drops padding — common in JWT and URL-safe tokens.

Does this support Unicode / UTF-8?

Yes. Text is encoded as UTF-8 bytes first, then Base64. Decoding produces the original Unicode string. If you see mojibake, the input may not be valid Base64 or was encoded with a different charset.

How is this different from Image ↔ Base64?

This page handles general text and raw bytes plus Base64url. Image ↔ Base64 focuses on photos — preview, MIME type, and download — not arbitrary UTF-8 strings.

Does my text or file leave the browser?

No. Conversion runs entirely in your browser with TextEncoder, btoa/atob, and FileReader. Your paste and files never leave the device.

What happens with invalid Base64 input?

Whitespace is ignored when decoding. Invalid characters, bad padding, or truncated strings throw an error. Very large pastes (>1M chars) may feel slow — try a shorter excerpt.

Related tools

  • Image to Base64 Converter — Encode & Decode Locally
  • JWT Decoder — Read Header & Payload Locally (No Verify)
  • HTML Entity Encoder & Decoder — Escape, Unescape & Local

Share this tool

Share on social networks, copy the page link, or use your device share sheet.

XFacebookLinkedInRedditWhatsAppTelegram

https://onlinefreetools.org/tools/base64

Questions or feedback

Something unclear, broken, or missing? Draft a message below — we read every note about these tools.

Email: dailyonetools@outlook.com

References

  • RFC 4648 — Base 64 Encoding
OnlineFreeTools.org · Learning project · Iterating
About·Dev Logs·Privacy·Terms·Contact