DT
DevToolKit
Clearly labeled tools
Tools
Workspaces
Resources
Browse tools
DT
DevToolKit
Practical PDF, image, developer, and everyday tools

Clearly labeled processing for everyday tasks.

Core processing runs in the browser for most tools. Server-backed and external-provider workflows are labeled separately. Basic tools are available without signup; individual limits vary by tool.

46 unique tools4 workspacesNo signup for basic tools
Browse toolsTrust Center
Tools
All toolsPDF workspaceImage studioDeveloper workbenchGeneral tools
Product
BlogSupportContact
Company
AboutTrust CenterPrivacy PolicyTerms of Use

© 2026 DevToolKit. Practical PDF, image, developer, and everyday tools with clearly labeled processing.

In-browserServer-backedExternal preview
amanhirut32@gmail.com
HomeToolsDeveloperBase64 Encoder/Decoder

Base64 Encoder/Decoder

  • In-browser
  • No signup
  • Free limit: Text input

Encode and decode Base64 text directly in your browser.

Core processing runs in your browser and does not upload this file for the task.

Preparing the editor...

The guide and instructions on this page are available while the tool loads.

Continue your workflow

  • JSON FormatterPretty-print decoded text when it is JSON. This Base64 page does not parse JSON.
  • JWT DecoderDecode header and payload JSON from a three-segment token. Does not verify signatures.
  • URL Encoder/DecoderPercent-encode or decode URI text with encodeURIComponent or encodeURI. Not Base64.

What Base64 encoding does

Base64 Encoder/Decoder turns textarea text into Base64, or Base64 back into text, using the browser’s TextEncoder, btoa, atob, and TextDecoder. The sidebar safety note states that Base64 is encoding, not encryption. The page does not hash, compress, percent-encode URLs, verify JWTs, or convert files.

Nothing runs until you select Encode Base64, Decode Base64, or Load example. The default mode is Encode, URL-safe is off, and Include padding is on. The input starts empty.

Encoding text versus decoding Base64 text

Encode and Decode are two buttons. handleModeChange stores the mode, then clears outputText and error. The input text and the two option checkboxes stay as they are. You must convert again after switching.

Encode
encodeText: UTF-8 bytes via TextEncoder, then bytesToBase64 (btoa). Optional URL-safe substitution and optional removal of trailing =.
Decode
decodeText: normalizeBase64Input, atob to bytes, then TextDecoder().decode. The padding checkbox is not passed into decode.
Empty input
If the trimmed textarea is empty, output is cleared. Encode shows “Enter text to encode.” Decode shows “Enter Base64 to decode.” Those buttons stay disabled while !inputText.trim().

Load example uses “Hello, DevToolKit! 🚀” in Encode and “SGVsbG8sIERldlRvb2xLaXQhIPCfkYs=” in Decode, then calls runConversion immediately.

Standard and URL-safe Base64

With URL-safe off, encode keeps btoa’s + and / characters. With URL-safe on, toUrlSafeBase64 replaces + with - and / with _ after btoa. The = padding character is not rewritten.

On decode, normalizeBase64Input maps - → + and _ → / only when urlSafe is true. This page does not detect URL-safe input automatically. It does not claim RFC 4648 Base64URL compliance beyond that substitution.

Padding and malformed input

Encode padding
Include padding default is true, so btoa’s trailing = stay. If you uncheck it, bytesToBase64 (and URL-safe encode again) strip /=+$/ from the encoded string.
Decode padding restore
After trim and whitespace removal, if length % 4 is 2 or 3, the function appends “=”.repeat(4 − remainder). Remainder 0 is left unchanged.
Remainder 1
normalizeBase64Input throws “Invalid Base64 input.” before atob.
Other failures
atob or later steps throw; the UI shows error.message, or “Could not process this input.” if message is missing. Output is cleared.

Decode also deletes all whitespace (trim, then replace /\s+/g). Wrapped Base64 can decode if the remaining alphabet is valid. Encode does not strip whitespace; spaces and line breaks in the input are part of the UTF-8 bytes that get encoded.

UTF-8 and text-output behavior

The Options panel labels text encoding as UTF-8. That label is static; there is no Latin-1, UTF-16, or hex selector. Encode uses new TextEncoder().encode(text). Decode uses new TextDecoder().decode(bytes) with no options (UTF-8 default). Invalid byte sequences are not turned into a dedicated UI error; this component does not pass fatal: true.

Under the input, a counter shows JavaScript character length, line count (split on \r\n, \r, or \n), and UTF-8 byte length of the current input. Empty input shows 0 / 0 / 0. The sidebar Summary uses input and output character counts, plus Yes/No for the two checkboxes—not whether the current output string actually contains =.

This is a text-in, text-out tool. Binary files, images, and data-URI prefixes are not a supported workflow. Decoded bytes that are not useful as Unicode text can still appear as text in the output textarea.

How to use the actual controls

  1. Click Encode or Decode.
  2. Set URL-safe Base64 and Include padding to match the alphabet and padding you need. Option changes do not replay the last run.
  3. Paste into Input text or Base64 input.
  4. Click Encode Base64 or Decode Base64.
  5. Read Base64 output or Decoded text.
  6. Click Copy output when the result is non-empty. On success the label reads Copied for 1.5 seconds.
  7. Click Download .txt for encoded-base64.txt in Encode or decoded-text.txt in Decode.
  8. Click Clear to empty input, output, error, and the Copied state. It does not reset mode, URL-safe, or padding.

What Base64 does not do

  • Not encryption or a way to hide secrets (the sidebar says this explicitly).
  • Not hashing.
  • Not compression.
  • Not URL percent-encoding (that is encodeURI / encodeURIComponent on URL Encoder/Decoder).
  • Not JWT splitting or signature verification.
  • Not file or binary conversion: textarea only; no file input; download is always a .txt of the output string.
  • Not automatic conversion, MIME 76-character wrapping, or an alphabet detector.
  • No implemented character ceiling in Base64Tool.jsx (very large strings are still bounded by the browser).

Privacy and browser-processing boundaries

Base64Tool.jsx encodes and decodes in the browser. It does not call trackToolEvent and does not POST the textarea to an encode/decode API. That is not a confidentiality guarantee: the rest of the page can still load site assets and advertising; the privacy policy describes first-party analytics for event metadata (not designed to store tool contents); clipboard writes, downloads, extensions, and shared devices stay outside this component.

Do not treat Base64 output as a protected secret. Local btoa/atob does not encrypt or isolate the text from the browser environment.

When to use JSON Formatter, JWT Decoder, or URL Encode instead

  • JSON Formatter — after decode, if the text is JSON, paste it there for JSON.parse / JSON.stringify pretty-print. This Base64 page does not parse JSON.
  • JWT Decoder — when the input is a three-segment token. That page Base64URL-decodes header and payload JSON and does not verify signatures. Pasting a full JWT here is not the same workflow.
  • URL Encoder/Decoder — when you need percent-encoding with encodeURIComponent or encodeURI, not Base64’s +/ alphabet. The two encodings are not interchangeable.

Output-review checklist

  • Confirm you used Encode versus Decode for the task; switching modes clears output.
  • If decoding -/_ input, enable URL-safe Base64, then convert again.
  • If a receiver requires trailing =, leave Include padding on and encode again after changing it.
  • If decode fails, read the message: empty-input copy, “Invalid Base64 input.” for remainder 1, or the engine message from atob.
  • Check the downloaded name: encoded-base64.txt versus decoded-text.txt.
  • If Copy output stays unchanged, the clipboard API may have been denied; the UI does not surface that as a red error.

Frequently asked questions

Does Base64 convert as I type?

No. Output updates only when you select Encode Base64, Decode Base64, or Load example. Editing the textarea or the URL-safe / padding checkboxes does not re-run conversion.

Is Base64 encryption, hashing, or compression?

No. This page maps text to an alphabet with btoa/atob. Anyone with the output can decode it. It does not use a secret, does not hash, and does not compress.

When does URL-safe Base64 apply?

On encode, if the checkbox is on, + becomes - and / becomes _. On decode, that mapping runs only if the checkbox is on. With it off, - and _ are left unchanged and atob typically fails.

Does Include padding affect decode?

No. decodeText only receives the urlSafe flag. Missing = characters are restored when the stripped length modulo 4 is 2 or 3. A remainder of 1 throws “Invalid Base64 input.” The padding checkbox only changes encoded output.

Related guides

Longer reads that pair well with this tool.

Developer guide

Useful Developer Tools Every Browser Should Have

Fourteen In-browser developer utilities for JSON, encoding, tokens, diffs, hashes, regex, SQL, UUIDs, and timestamps — fast checks without installing anything.

Developer guide

How to Format JSON Online

Use automatic JSON.parse and JSON.stringify formatting, inspect strict-JSON parser errors, and review indented text up to 1,000,000 characters.

Developer guide

How to Redact and Review Sensitive JSON

Reduce exposure while reviewing sensitive JSON by using synthetic data, redacting credentials and identifiers, and checking browser, screen, and clipboard risks.

Related tools

Common next steps after using this tool.

JSON Formatter

Automatically format and validate JSON in your browser.

JWT Decoder

Decode JSON Web Tokens directly in your browser.

URL Encoder / Decoder

Encode and decode URLs, query parameters, and text directly in your browser.

Explore more in Developer

Browse related tools or open the full workspace.

Developer workspaceAll tools