Loading TOML to Base64 Converter...
How to Convert TOML to Base64
Add your TOML
Paste a config or a snippet, upload a .toml file, or click Sample to load a short Cargo.toml-style example with a few tables.
Read the Base64
About a third of a second after you stop typing, the Base64 string appears on the right. If the text does not parse as TOML, a note names the line and column, and it is still encoded exactly as typed. The output is standard RFC 4648 Base64 with +, / and = padding, on one line, the same as base64 -w0 Cargo.toml gives you.
Copy or download it
Click Copy to put the string on your clipboard, or Download to save it as encoded-base64.txt. Both use whatever is in the editor at that moment, ready to paste into a CI variable, a Secret or a JSON field.
echo "$APP_CONFIG" | base64 -d > config.tomldata in a Secret, or under binaryData in a ConfigMap, for a container to mountWhat is TOML to Base64 Encoding?
TOML (Tom's Obvious Minimal Language) to Base64 encoding rewrites a configuration file as plain ASCII so it can pass through places that would otherwise mangle it. Double quotes, # comments, square brackets and line breaks are exactly the characters that shell variables, YAML files and JSON strings treat specially.
The page uses the TextEncoder API to turn your TOML into UTF-8 bytes and then encodes those bytes in chunks, so even a large config works. Tools like Cargo (Rust), Poetry and pip (Python) and Hugo all read TOML, and Base64 lets those files ride through text-only channels without getting corrupted. Keep in mind that Base64 is reversible by anyone: it makes a file easy to carry, not secret.
Frequently Asked Questions
Why encode a TOML config as Base64?
A pyproject.toml fragment, a Cargo.toml snippet or a settings file often has to travel through somewhere that treats its characters specially. Dropped into a CI/CD variable, a Kubernetes Secret, a JSON request body or a shell command, a stray double quote, a # that reads as a comment or a line break can all trip things up. Base64 turns the whole file into letters, digits, +, / and =, so it rides through YAML, JSON and environment variables untouched and is decoded right before it is read.
Does my config come back exactly the same?
Yes. The TOML is turned into UTF-8 bytes and only those bytes are encoded, so nothing is reformatted or reparsed. Comments, blank lines, CRLF endings, accented text and values such as 8901240544102066246, "00501" or 14.50 decode back character for character. For example, port = 8080 followed by a line break becomes cG9ydCA9IDgwODAK.
Does it check that my TOML is valid?
It takes a look, but it never stops you. If the text doesn't parse as TOML, a note points to the line and column where the problem starts and the bytes are still encoded exactly as typed, which is what you want when you are only moving the file around. It parses to TOML 1.0, so mixed-type arrays, dates and 64-bit integers are all fine. To actually fix broken TOML, open the TOML Validator or TOML Formatter.
Is an uploaded .toml file encoded byte for byte?
Yes. An upload is read as raw bytes, so a byte-order mark, Windows line endings or a file saved as Windows-1252 end up in the Base64 exactly as they are on disk. A file that isn't UTF-8 text isn't shown in the editor, but its bytes are still what you get. Text you type or paste is encoded as UTF-8.
Does Base64 keep secrets in my config safe?
No. Base64 is an encoding, not encryption, and anyone with the string can decode it in a second, for instance on the Base64 to TOML page. A Kubernetes Secret is only Base64 as well, so if a config holds API tokens or database passwords, keep it in a real secret manager or encrypt it. Base64 just makes the text safe to carry.
Where does my TOML go, and how large can a file be?
Nowhere. The encoding runs in your browser and the download is built on your machine; nothing is uploaded and nothing is kept, so a reload starts with an empty editor. There is no fixed size cap. A normal config encodes instantly, while very large files are limited only by the memory your browser has. The Base64 ends up about a third longer than the TOML.
Related pages: Base64 to TOML · TOML Validator · TOML Formatter · Base64 Encoder
Related Tools
Text to Base64
Encode plain text to Base64 format for APIs and data transmission
Base64 to Text
Decode Base64 encoded data to plain text for reading and debugging
JSON to Base64
Convert JSON data to Base64 format with validation
Base64 to JSON
Convert Base64 encoded data to JSON format with validation
XML to Base64
Convert XML data to Base64 format with validation
Base64 to XML
Convert Base64 encoded data to XML format with validation