Text is converted to bytes first
A TextEncoder creates UTF-8 bytes so accented characters and other Unicode text are handled consistently. Encoding JavaScript code units directly would corrupt many non-ASCII strings.
Encode text or files to Base64 and decode Base64 strings back to their original form.
Enter plain text to encode or a Base64 string to decode.
Select encode to convert text or decode to reveal the original.
Click copy to grab the encoded or decoded result.
Base64 represents binary data with a restricted set of printable characters. This tool encodes text as UTF-8 bytes before producing Base64, and reverses that process when decoding. Base64 is an encoding, not encryption: anyone who receives the string can decode it without a key.
A concrete input and expected output from the current implementation.
Input
b2KIT
Expected output
YjJLSVQ=
The five UTF-8 bytes for b2KIT are grouped into six-bit values and mapped to the standard Base64 alphabet. The final equals sign is padding.
A TextEncoder creates UTF-8 bytes so accented characters and other Unicode text are handled consistently. Encoding JavaScript code units directly would corrupt many non-ASCII strings.
The decoder removes spaces and line breaks before calling the browser Base64 decoder. This permits wrapped Base64 content while still reporting invalid alphabet or padding errors.
Padding completes the final four-character group when the input byte count is not divisible by three. Some protocols omit padding, but the underlying data is unchanged.
No. Base64URL substitutes URL-safe characters for plus and slash and often omits padding. JWT segments, for example, use the URL-safe variant.
The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.
Format, validate, and beautify JSON with syntax highlighting and error detection.
Format and indent SQL queries for better readability across all major dialects.
Convert HTML markup into clean Markdown syntax with support for tables and lists.
Write Markdown and see the rendered HTML output in real time with live preview.
Visualize unified diffs and patch files with color-coded additions and deletions.
Test regular expressions against sample text with real-time match highlighting.