LocalUtils field note · Convert text between UTF-8, Base64, and hexadecimal
Convert text between UTF-8, Base64, and hexadecimal
Base64 and hexadecimal are reversible text representations of bytes. They help move data through systems that expect printable characters, but they do not provide secrecy, authenticity, or access control.
The converter is suited to ordinary UTF-8 text and encoded strings that fit comfortably in browser memory. It is not a streaming binary-file encoder and should not be used to conceal passwords, tokens, or private records.
Quick start
- Identify whether the source is plain UTF-8 text, Base64, or hexadecimal before choosing a direction.
- Paste a small known sample and convert it once.
- Reverse the conversion and compare the recovered text or bytes with the original.
- When using the result in another system, confirm its alphabet, padding, byte encoding, and expectations for line breaks or prefixes.
device → browser engine → result
What the browser does
The browser converts text to UTF-8 bytes and represents those bytes as Base64 or hexadecimal. Decode operations reverse the representation and interpret recovered bytes as text.
No encryption key is involved. Anyone with the encoded value can normally decode it. The text stays in the browser utility path but can remain in clipboard history or browser-managed form state after use.
Inputs and outputs
- Text input and output use UTF-8 expectations.
- Base64 uses the standard alphabet and may include equals-sign padding.
- Hexadecimal requires pairs of valid hex digits representing bytes.
Limits to know before you start
- Arbitrary binary data may not decode to meaningful UTF-8 text.
- URL-safe Base64 variants can use different characters and padding rules.
- Odd-length or non-hex characters make hexadecimal invalid.
- Large values expand in Base64 or hex and can make a text-area workflow inefficient.
Troubleshooting
- If Base64 decoding fails, remove surrounding labels and check whether the source uses a URL-safe alphabet.
- If text is garbled, confirm the original byte encoding rather than assuming UTF-8.
- If hex fails, remove spaces or prefixes only when the destination format does not require them and confirm an even digit count.
Verification checklist
- Round-trip a known sample through encode and decode.
- Compare byte length and exact characters, including whitespace.
- Treat every decoded value as untrusted input before placing it in HTML, a command, or a program.
Questions people ask
Is Base64 encryption?
No. It is a public encoding that can be reversed without a secret key.
Why is Base64 longer than the original?
It represents each group of binary bytes with printable characters, adding roughly one third plus optional padding.
Can this convert any file?
The interface is designed for text-sized values. Large or arbitrary binary files need a streaming file encoder and an output workflow that preserves bytes.
