格 千格 KiloCell

Base64 Encoded Full Guide: Text, Pictures and URL-safe

Update 2026-08-08 About 12 minutes development tools How-to

The interface requires that binary be inserted into JSON, mail/ logs only by text channel, or that the first reaction to write small icons into Data URI at the front end is often "Base64 first". This Guide distinguishes between encoding and encryption, standards and URL-safe, text and file paths, gives steps, original error tables and real scenes that can be done on KiloCell of pages, and avoids using Base64 as a secret or throwing JWT paragraphs hard into the General Codec.

Use tools immediately Base64 - Decoding text and file in browser, local processing
Open tool →

The core sentence.

Base64 converts bytes only to printable characters; Anyone can decode it. It's not encrypted.

The code addresses "the channel is text-only or the need to embed any byte into HTML/JSON". Confidentiality depends on HTTPS, access control and real encryption algorithms. Here's to go, "What is it, a tumbler concept, a tool operation, a twilight, a scene, a selection," the main tool is: Base64 Encoded。

Base64, what's the problem?

Base64(RFC 4648) with 64 printable characters (A–Z a–z 0–9 + /, and fill =) is an arbitrary binary. The 3 byte map is 4 characters with approximately expansion in size 33%。 The price is volume, and the proceeds are:

  • The medium (partly configured, part log, XML/JSON field) that allows text only to be inserted.
  • It's written in Data URI, so small resources don't make requests alone.
  • The ability to travel without loss between the "manufacturing alphanumeric string" and the original byte (with the correct character set and variant).

It doesn't hide. Anyone who puts a string into the decoding device can restore it. If the key, ID number "Bas 64" is entered in the library or written at the front end, it is the same as explicit outgoing.

It's not the same as Hash. (a) The irreversible use of Hashi (MD5/SHA) for fingerprints; Base64 Reversible, used in transport form. Please use the validation of completeness Hash GeneratorsDon't mix it.

Standard Base64 with URL-safe

Variable Letter differences Fill Typical uses
Standard Base64 + / Keep = Mail, Data URI, Universal API
Base64URL - _ Replace + / Always omitted = JWT, partial URL query, Outlook

The usual KiloCell of-grambed text decoding walkers Standard Base64(internal use) btoa/atob Path and processing UTF-8. If you have a JWT type Base64URL, use it first. JWT decoder; If only plain URL-safe text, you can first -→+、_→/and by length = The text decoder is also used in this tool.

Three paths for text, Unicode and files

1. Plain text (in Chinese)

Page "Text Convert" Area Input (UTF-8)。 Encoding buttons will press Unicode text by UTF-8 bytes Base64, so Chinese and emoji can go and go, instead of simply stuffing JS's UTF-16 in btoa It leads to a false reporting.

Example: Express Hello. The code should be followed by a stable series of Base64; And a little bit of text decoded. Hello.。 If you use Latin-1 misunderstanding codes in other systems, there's a glitch -- that's character set, not Base64 math error.

Picture / Any File →Data URI

Below "Turn Files Base64." Supports clicking or dragging. Use on FileReader.readAsDataURL, output similar:

data:image/png;base64,iVBORw0KGgo...

Directly attached <img src="..."> Or CSS. Scripts have a ceiling on too big files (the achievement of a side app of 20MB would be rejected; The page tip does not exceed approximately 10MB. Large chart requests that priority objects be stored + URLs, rather than embedded in the entire page.

Just "naked" Base64, no. data: Prefix

Data URI prefixes are useful for HTML and are redundant for "interfaces only base 64 fields". Remove it in the output if you need it. data:mime;base64, Prefixes, only the load after comma is retained. This tool file path is in the Data URI form, text path output is a pure Base64 string - select the entry by interface document.

What do you do on the 1,000?

tools page:Base64 Encoded。 Calculates local completion in browsers; The government is still not using production keys as demonstration material for long periods of time on public computers.

Text Encoding

  1. Open /tools/dev/base64I found it. Text Conversion Card.
  2. On the left. Input (UTF-8) Paste or enter an express; Available Paste Write from the clipboard.
  3. Click Text Encoding。 Right OutputResult Beside Base64; Status bar and character count check if empty input is available.
  4. It takes time to take away. CopyOutput。 Show to colleagues ShareResult(Put content through address clips, note that the link may contain data you just encoded).
  5. - It's over. Clear, avoids keeping sensitive content on the page.

Text decode

  1. Place Base64 string in left input (no extra) Bearer , quotation marks, or data:...;base64, Prefixes unless you intend to treat the whole paragraph as text).
  2. Points Text decode。 Success is UTF-8 text on the right; Failed to see status bar (unlawful characters, error filling, etc.).
  3. If the source is URL-safe or JWT, the variant is judged first, and the characters or JWT tools are changed if necessary.

File Transfer

  1. Get out of here! File Transfer Card.
  2. Click to select the area file, or drag the file into the frame.
  3. After success, the file name and volume show that the output area appears in the form of Data URI Base64.
  4. (b) Compressing pictures or switching to outer chains when they are too large; Do not force the multitrillion-encrypted resource into the frontend package.

Capacity boundaries (relative to real pages)

  • Yes: Text decode (UTF-8), file transfer Data URI/Base64, paste/copy/sharing/cleaning, local processing.
  • There's no single switch: One key "URL-safe alphabet only" mode - needs to be manually converted or converted to a JWT tool above.
  • No substitute: Encryption, permission, protection against tampering (conversion to signature/Hashi, not Base64).

Common error and contrast

phenomena Common causes Processing
Decoding failed/ Invalid Character Into line break, spaces,"or URL % Not returned yet Remove the blanks and quotation marks. If a URL encoding has been used, go first URL encoding
Chinese Spell One-end interpretation bytes by error character set UTF-8 harmonization; This tool text path is designed by UTF-8
+ Change spaces in URLs Query Threads + (a) When spaces; Standard Base64 contains + Before entering URL, do a percentage-code or change to Base64URL
Missing = Filling Failed (b) The transfer is carried out with the striping of the fill; Or from Base64URL Press length mod 4 to fill = Again.
JWT Post-entry tool unsolved or unwieldy JWT is Base64URL and in bits Use JWT decoder
Access denied after file transfer Too many. data:image/...;base64, Prefix Only the load after the comma
Page Cardon or File Deny It's too big. Compress or upload the currents without embedding
"And when it's coded, it's not open." The counterparty used a URL-safe alphabet or different line folding policy Alignment of RFC variants with permitted blanks

Wrong order

  1. Confirms whether the string set is the standard Base64 alphabet.
  2. Confirms whether there is a Data URI prefix, or a URL percentage code layer.
  3. Whether or not the text should go UTF-8 (the Chinese scene is almost always).
  4. Whether or not the JWT/Hashi tool should actually be used instead of the Universal Base64.

Real work scenarios

Scenario A: interface field to pass small files

The product requires a thumbnail in JSON. Use File Transfer After generation, the Data URI prefix is left or removed by a backend agreement, re-evaluate the volume: Base64 will put about one third of the gateway body limit together. The text decoded during the connection to check "the same file before and after the code" faster than the oral text-to-sh. If you want to match the official verification, then you can't. Hash Generators。

Scenario B: CSS/HTML embedded icon

Drag 1 to 2KB SVG/PNG into a tool, copy data: Serial background-image or <img>。 Cache and maintenance: change a pixel to a string; More than one icon should be changed to a font icon or a chuptiogram/ standalone URL.

C: Long Serials in the log

Some intermediates post-log the request or key material Base64. Copy to This Tool Text decode Revertable (if the other party admits it is Base64). If it is still binary, it may be encrypted and Base64 — decoded only to strip off the shell and not provide the key.

Scenario D: supermuted with URL

Short arguments are first Base64 and then when you put them in the query string,+ / = It's gonna be a mess. The correct order is usually: binary → Base64 (or Base64URL) → if necessary URL encoding。 This tool is responsible for the first half of the year.URL encoding Responsible for the latter part; The blogger says that the government is not going to do it once, assuming that it can paste it as it is in the address bar.

Scenario E: Misplace Base64 as password storage

The history system has a "Class 64 repository". Decode is clear. The tool, which should be changed to slow-hashi (bcrypt/scrypt/Argon2, etc.) for migration, is used only to understand the status and migration reconciliation and is not a password program.

Scene F: The teaching demonstration "Fightable and reverse"

Encoding with non-sensitive samples, decoded, and explaining to the newcomers "looks messy and safe." Compare SHA-256 (Hashi Tool) with Base64, creating a "fingerprint vs transport code" instinct.

Security and privacy

  • Default hypothesis Base64 It can be restored to anyone.; Do not use encryption when it is available.
  • Production of key, document scan: even if local tools are not available, the link between screen sharing and "sharing of results" may be leaked.
  • We're running out of public computers. Clearand consider cleaning the clipboard.
  • Data URI into the warehouse expands Git history; Large resource walk-in storage.
  • The mail, the bill, the Base 64 before the sensibilities.
  • The need to prevent tampering with signatures or Hash, rather than "Base64 again".
  • (a) The KiloCell of-grambed page logic is executed in the browser; Still only processing data that you are authorized to process.

FAQ

Base64, is it encrypted? Can you hide the code?

Nope. It's just code. The password should be stored using a specific password, Hashi, or encryption scheme, and should be accompanied by HTTPS and permissions. The password Base64 is either stored in the back or written to the front end, and the assailant is similarly returned.

Why is the same Chinese on A website and B website Base64 different?

Possible character sets (UTF-8 vs GBK), whether to compress first, to fold or not (76 characters for MIME), to URL-safe. (a) Confirm the original bytes and then compare the coding results; This tool text path is by UTF-8.

What if the page slows down after Base64?

Embedded to increase the volume of HTML/CSS, which prevents the cache of particles. Small icons are acceptable; Large, multi-text URL references. The tool side also has a volume ceiling and super-sniffs should be replaced by upload links.

Wrong hint when decoded, but the string "looks like" Base64?

Check if you're mixed up. data: Prefix, blank, URL code, or actually Base64URL/hexadecimal. Cleaning and then decomposing; JWT, please use a dedicated decodor.

Is Sharing Results safe?

Sharing dependence on putting content in open-link form, facilitating collaboration, also means If you get the link, you get the content.。 (b) Use only for non-sensitive examples; Sensitive data is encrypted using point-to-point channels, not by sharing buttons.

and `btoa '/ `Buffer.from' (str,'base64') 'is not the same?

Node is not the same encoded path as the browser's default processing string. The UTF-8 bytes are unified and then Base64 is aligned. This tool is used to manually cross-check, based on the code specified in the interface document.

Continue reading

A non-sensitive Chinese word for "coding copy code decoded empty" and a small PNG for the file area can create a correct mental model.