Base64 to CSV Converter
Decode Base64-encoded strings to CSV format instantly. Preview data in a table, validate structure, detect delimiters, and download clean CSV files.
About
Base64 encoding inflates payload size by approximately 33% and obscures the underlying data structure. When the encoded payload is tabular data (CSV, TSV), a decoding error or charset mismatch silently corrupts field values. Truncated padding characters (=) cause NULL byte injection. Misidentified delimiters collapse multiple columns into one. This tool decodes Base64 input using the native atob function with full UTF-8 reconstruction via TextDecoder, then parses the result as structured CSV with automatic delimiter detection by frequency analysis. It handles RFC 4648 standard and URL-safe alphabets. Note: this tool assumes the encoded content is plaintext CSV. Binary formats (XLSX, ODS) embedded in Base64 require a different decoder.
Formulas
Base64 encoding maps every 3 input bytes (24 bits) to 4 printable ASCII characters (6 bits each). The decoded byte length is computed as:
where Lencoded = length of the Base64 string (excluding whitespace), and P = number of padding = characters (0, 1, or 2).
Delimiter auto-detection uses a frequency consistency score. For each candidate delimiter d, the tool counts occurrences per line and computes variance:
where ci = count of delimiter d on line i, and = mean count across all lines. The delimiter with the lowest non-zero variance and highest mean count is selected. A variance of 0 with ≥ 1 indicates a perfectly consistent structure.
URL-safe Base64 substitution rule: + → - and / → _. The tool normalizes URL-safe input before decoding.
Reference Data
| Base64 Character | Index | Binary | Notes |
|---|---|---|---|
| A - Z | 0 - 25 | 000000 - 011001 | Uppercase Latin |
| a - z | 26 - 51 | 011010 - 110011 | Lowercase Latin |
| 0 - 9 | 52 - 61 | 110100 - 111101 | Digits |
| + | 62 | 111110 | Standard alphabet |
| / | 63 | 111111 | Standard alphabet |
| - | 62 | 111110 | URL-safe variant |
| _ | 63 | 111111 | URL-safe variant |
| = | - | - | Padding (mod 4 alignment) |
| Delimiter | Name | Common Use | Detection Priority |
| , | Comma | RFC 4180 CSV standard | 1 (highest) |
| ; | Semicolon | European locale CSV exports | 2 |
| \t | Tab | TSV files, database exports | 3 |
| | | Pipe | Legacy systems, mainframes | 4 |
| Input Size | Encoded (Base64) | Decoded (Bytes) | Overhead |
| Small | 1 KB | 768 B | 33.3% |
| Medium | 100 KB | 75 KB | 33.3% |
| Large | 1 MB | 768 KB | 33.3% |
| Max recommended | 10 MB | 7.5 MB | 33.3% |
| Padding | Input Length mod 3 | Pad Characters | Example |
| No padding | 0 | 0 | QUJD |
| Single pad | 2 | 1 | QUI= |
| Double pad | 1 | 2 | QQ== |