Splitter
Base64 line splitter online. Split long Base64 strings into lines for embedding in code, config files, or PEM certificates. Free browser tool.
Base64 Input
Split Output
Common Chunk Sizes
Features
- Split Base64 into fixed-length lines
- Configurable line width (e.g., 64, 76, 80 characters)
- PEM certificate format support
- Preserve or add line breaks
- Join split Base64 back to single line
- Copy formatted output
Common Use Cases
- Format Base64 for PEM certificates
- Split Base64 for email embedding (RFC 2045)
- Create readable multi-line Base64 in code
- Format Base64 for configuration files
- Match Git commit or line length limits
Base64 Line Splitting
Base64 line splitting divides long Base64 strings into multiple lines of fixed width. This improves readability and meets format requirements for standards like PEM and MIME.
Common line widths:
- 64 characters - PEM certificates and SSH keys
- 76 characters - MIME email encoding (RFC 2045)
- 80 characters - General code formatting
- Custom - Any width for specific requirements
PEM format example:
-----BEGIN CERTIFICATE----- MIIDXTCCAkWgAwIBAgIJAKL0UG... vHxRKYs4h3JZlJYuFWvwxf7aO... -----END CERTIFICATE-----
Why split Base64? Many text formats have line length limits. Email standards limit lines to 76 characters. Code editors use 80-120 character limits. Splitting prevents horizontal scrolling and meets format specifications.
Examples
Original:
SGVsbG8sIFdvcmxkISBUaGlzIGlzIGEgbG9uZyBCYXNlNjQgc3RyaW5n...
Split (64 chars/line):
SGVsbG8sIFdvcmxkISBUaGlzIGlzIGEgbG9uZyBCYXNlNjQgc3RyaW5n
dGhhdCBuZWVkcyB0byBiZSBzcGxpdCBmb3IgUEVNIGZvcm1hdA==-----BEGIN CERTIFICATE-----
MIIDXTCCAkWgAwIBAgIJAKL0UG4Nbj0FMA0GCSqGSIb3DQEBBQUAMEUGS
...
-----END CERTIFICATE-----SGVsbG8sIFdvcmxkISBUaGlzIGlzIGEgdmVyeSBsb25nIEJhc2U2NCBlbmNvZGVkIHN0cmluZyB0aGF0IHdpbGwgYmUgc3BsaXQgaW50byBtdWx0aXBsZSBsaW5lcyBmb3IgYmV0dGVyIHJlYWRhYmlsaXR5IGFuZCBjb21wYXRpYmlsaXR5Frequently Asked Questions
PEM (Privacy Enhanced Mail) format uses 64 characters per line. Certificates and keys are wrapped with -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- headers, with Base64 content split into 64-character lines between them.
No. Splitting only adds newline characters (\n). The Base64 characters remain identical. When decoding, most tools ignore whitespace, so split and non-split Base64 decode to the same binary data.
Remove all newline and whitespace characters. In JavaScript: base64.replace(/\s+/g, ""). In Python: "".join(base64.split()). Our tool provides a "Join" option to convert split Base64 back to a single line instantly.
RFC 2045 (MIME) specifies 76 characters per line for email Base64 content. This prevents mail transfer agents from breaking lines arbitrarily, which can corrupt the message. Modern email clients handle this automatically.
No. Best practice is to use a consistent line length throughout the entire Base64 block. Mixing line lengths makes the content harder to parse and may violate format specifications like PEM, which strictly requires 64 characters.