Chunkify a String
Split any string into fixed-size chunks instantly. Supports Unicode, custom separators, multiple output formats, and copy-to-clipboard.
About
Splitting a string into equal-length segments is a routine operation in data formatting, serial number generation, cryptographic key display, and transmission protocol compliance. A naive substring loop will silently break multi-byte Unicode sequences - emoji, CJK ideographs, and combined diacritics get severed into invalid code points. This tool chunks by grapheme-aware codepoint count using Array.from, so a chunk size of 4 always means four visible characters, not four bytes. It handles edge cases: chunk size larger than the string, chunk size of 1, and empty input. The last chunk may be shorter than n; padding options let you normalize it.
Practical applications include formatting credit card numbers (4-digit groups), displaying SHA-256 hashes (8-char blocks), preparing data for fixed-width file formats, and segmenting DNA/RNA sequences for readability. The tool approximates no biological or cryptographic function - it is a deterministic string slicer with zero data loss.
Formulas
The chunking operation is a deterministic partitioning of an ordered sequence of length L into segments of fixed width n.
where k is the total number of chunks produced, L is the input string length in codepoints, and n is the chunk size. Each chunk Ci is extracted as:
for i β {0, 1, β¦, k β 1}. The last chunk has length r = L mod n. When r = 0, all chunks are uniform. When r β 0 and padding is enabled, the last chunk is right-padded with the pad character to length n.
Reference Data
| Use Case | Typical Chunk Size | Separator | Standard / Context |
|---|---|---|---|
| Credit Card Display | 4 | Space | ISO/IEC 7812 |
| IBAN Formatting | 4 | Space | ISO 13616 |
| MAC Address | 2 | Colon : | IEEE 802 |
| IPv6 Address | 4 | Colon : | RFC 4291 |
| SHA-256 Hash Display | 8 | Space | NIST FIPS 180-4 |
| UUID Segments | 8-4-4-4-12 | Hyphen - | RFC 4122 |
| Binary Octets | 8 | Space | Digital Logic |
| Hex Dump (Word) | 4 | Space | Memory Inspection |
| Hex Dump (DWord) | 8 | Space | Memory Inspection |
| DNA Codon Triplets | 3 | Space | Molecular Biology |
| RNA Codon Triplets | 3 | Space | Molecular Biology |
| Base64 Line Wrap | 76 | Newline | RFC 2045 (MIME) |
| PEM Certificate Lines | 64 | Newline | RFC 7468 |
| Fixed-Width Data Field | Variable | None | COBOL / Mainframe |
| QR Code Data Segments | Variable | None | ISO/IEC 18004 |
| Morse Code Groups | 5 | Space | ITU-R M.1677 |
| NATO Message Groups | 5 | Space | ACP 131 |
| Telephone Number (US) | 3-3-4 | Hyphen - | NANP |
| Serial Key (Software) | 5 | Hyphen - | Industry Convention |
| Barcode Data (EAN-13) | 1-6-6 | Space | GS1 |