Convert Base64 to TOML

Drag and drop files here or click to select.
Max file size 100mb.
Uploading progress:

Base64 vs TOML Format Comparison

Aspect Base64 (Source Format) TOML (Target Format)
Format Overview
Base64
Binary-to-Text Encoding Scheme

Base64 is a binary-to-text encoding that uses 64 ASCII characters to represent binary data. Commonly used in email attachments, data URIs, JWT tokens, and Basic Authentication headers. It provides a safe way to transport binary content through text-based protocols and systems without data corruption.

Encoding Scheme Binary-to-Text
TOML
Tom's Obvious, Minimal Language

TOML is a configuration file format designed to be easy to read and write due to its clear semantics. Created by Tom Preston-Werner (GitHub co-founder) in 2013, TOML maps unambiguously to a hash table. It is the standard configuration format for Rust (Cargo.toml), Python (pyproject.toml), and many modern development tools.

Configuration Human-Readable
Technical Specifications
Structure: Continuous ASCII character string
Character Set: A-Z, a-z, 0-9, +, / (and = padding)
Padding: = or == for byte alignment
Size Overhead: ~33% larger than source
Standard: RFC 4648
Structure: Key-value pairs with sections
Encoding: UTF-8 required
Data Types: String, Integer, Float, Boolean, DateTime, Array, Table
Comments: # line comments
Extensions: .toml
Syntax Examples

Base64 encoded configuration:

W3NlcnZlcl0KaG9zdCA9ICIw
LjAuMC4wIgpwb3J0ID0gODA4
MApkZWJ1ZyA9IGZhbHNlCgpb
ZGF0YWJhc2VdCmVuZ2luZSA9
ICJwb3N0Z3Jlc3FsIg==

TOML configuration format:

[server]
host = "0.0.0.0"
port = 8080
debug = false

[database]
engine = "postgresql"
name = "myapp_db"
max_connections = 25
Content Support
  • Any binary data (images, documents, audio)
  • Text content in any character encoding
  • Structured data (JSON, XML, YAML, TOML)
  • Cryptographic keys and certificates
  • Email attachments (MIME)
  • JWT tokens and authentication headers
  • Data URIs for web embedding
  • Strings (basic, literal, multiline)
  • Integers and floating-point numbers
  • Booleans (true/false)
  • Date-time values (RFC 3339)
  • Arrays (homogeneous and mixed)
  • Tables (sections) and inline tables
  • Array of tables for repeated sections
Advantages
  • Universal binary data transport
  • Supported by all programming languages
  • No special character conflicts
  • Standard for email and web protocols
  • Simple encoding and decoding
  • Platform-independent representation
  • Extremely human-readable
  • Unambiguous mapping to hash tables
  • Native date-time support
  • Comments supported (unlike JSON)
  • Strong typing for all values
  • Standard for Rust and Python tooling
  • Formal specification (TOML v1.0)
Disadvantages
  • 33% size increase over binary data
  • Not human-readable without decoding
  • No structural information or formatting
  • Content hidden until decoded
  • Cannot be searched or filtered directly
  • Less widely adopted than JSON or YAML
  • Verbose for deeply nested structures
  • Limited tooling compared to JSON/YAML
  • No support for null values
  • Complex syntax for nested arrays of tables
Common Uses
  • Email attachments (MIME encoding)
  • Data URIs in web development
  • JWT tokens and API authentication
  • Binary data in JSON/XML payloads
  • Certificate and key storage
  • Rust package config (Cargo.toml)
  • Python project config (pyproject.toml)
  • Hugo static site configuration
  • Netlify deployment settings
  • Application configuration files
  • Infrastructure-as-code settings
Best For
  • Binary data in text protocols
  • Embedding files in web pages
  • API authentication tokens
  • Safe data serialization
  • Application configuration files
  • Build system and tooling config
  • Project metadata definitions
  • Settings with comments and types
Version History
Introduced: 1987 (Privacy Enhanced Mail)
Standard: RFC 4648 (2006)
Status: Universally adopted
Variants: Standard, URL-safe, MIME
Introduced: 2013 (Tom Preston-Werner)
Current: TOML v1.0.0 (2021)
Status: Stable, formally specified
Evolution: v0.1 through v1.0
Software Support
Python: base64 module (standard library)
JavaScript: btoa() / atob() built-in
Java: java.util.Base64
Other: All languages, browsers, CLI tools
Python: tomllib (3.11+), tomli, toml
Rust: toml crate (Cargo native)
Go: BurntSushi/toml
Other: JS, Ruby, Java, C++ libraries

Why Convert Base64 to TOML?

Converting Base64 encoded data to TOML format is valuable when configuration data or structured settings have been encoded for safe transport and need to be restored to a human-readable, editable configuration file. TOML's clear key-value syntax and section-based organization make it an ideal target format for decoded configuration payloads that need to be reviewed, modified, or deployed in modern development environments.

In DevOps and cloud deployment pipelines, configuration data is frequently Base64-encoded for storage in environment variables, Kubernetes secrets, CI/CD pipelines, or API responses. When this encoded data contains application settings, converting it to TOML provides a clean, well-typed configuration file that developers can easily read and maintain. TOML's strict typing ensures that integers, floats, booleans, and date-time values are properly represented.

TOML has become the standard configuration format for the Rust ecosystem (Cargo.toml), Python packaging (pyproject.toml), and modern tools like Hugo and Netlify. By converting Base64-encoded configuration data to TOML, you produce files that integrate directly into these ecosystems. The format's support for comments allows you to annotate settings with explanations, something not possible in JSON or the encoded Base64 source.

The conversion process decodes the Base64 input, parses the underlying data structure, and generates properly formatted TOML with appropriate sections, data types, and formatting. Nested structures map to TOML tables, repeated elements become arrays of tables, and primitive values are typed correctly. The result is a specification-compliant TOML file ready for use in any compatible application.

Key Benefits of Converting Base64 to TOML:

  • Human Readable: Transform opaque encoded data into clear key-value configuration
  • Strong Typing: Values are properly typed as strings, integers, booleans, or dates
  • Comment Support: Add explanatory comments to decoded configuration values
  • Rust/Python Standard: Output integrates with Cargo.toml and pyproject.toml ecosystems
  • Section Organization: Structured data maps naturally to TOML tables and sections
  • Specification Compliant: Generated TOML follows the official v1.0 specification
  • DevOps Integration: Decode Kubernetes secrets and CI/CD configs to editable TOML

Practical Examples

Example 1: Decoding Application Configuration

Input Base64 file (app_config.base64):

W3NlcnZlcl0KaG9zdCA9ICIwLjAuMC4wIgpwb3J0ID0g
ODA4MApkZWJ1ZyA9IGZhbHNlCndvcmtlcnMgPSA0Cgpb
ZGF0YWJhc2VdCmVuZ2luZSA9ICJwb3N0Z3Jlc3FsIgpu
YW1lID0gIm15YXBwX2RiIgpob3N0ID0gImxvY2FsaG9z
dCIKcG9ydCA9IDU0MzI=

Output TOML file (app_config.toml):

[server]
host = "0.0.0.0"
port = 8080
debug = false
workers = 4

[database]
engine = "postgresql"
name = "myapp_db"
host = "localhost"
port = 5432

Example 2: Decoding Python Project Metadata

Input Base64 file (project.base64):

W3Byb2plY3RdCm5hbWUgPSAibXktcGFja2FnZSIKdmVy
c2lvbiA9ICIxLjIuMyIKZGVzY3JpcHRpb24gPSAiQSBz
YW1wbGUgUHl0aG9uIHBhY2thZ2UiCnJlcXVpcmVzLXB5
dGhvbiA9ICI+PTMuOCIKZGVwZW5kZW5jaWVzID0gWwog
ICAgInJlcXVlc3RzPj0yLjI4IiwKXQ==

Output TOML file (pyproject.toml):

[project]
name = "my-package"
version = "1.2.3"
description = "A sample Python package"
requires-python = ">= 3.8"
dependencies = [
    "requests>=2.28",
]

Example 3: Decoding Deployment Settings

Input Base64 file (deploy.base64):

W2J1aWxkXQpjb21tYW5kID0gImh1Z28gLS1taW5pZnki
CnB1Ymxpc2hfZGlyID0gInB1YmxpYyIKZW52aXJvbm1l
bnQgPSAicHJvZHVjdGlvbiIKCltbcmVkaXJlY3RzXV0K
ZnJvbSA9ICIvb2xkLXBhZ2UiCnRvID0gIi9uZXctcGFn
ZSIKc3RhdHVzID0gMzAx

Output TOML file (netlify.toml):

[build]
command = "hugo --minify"
publish_dir = "public"
environment = "production"

[[redirects]]
from = "/old-page"
to = "/new-page"
status = 301

Frequently Asked Questions (FAQ)

Q: What is Base64 encoding?

A: Base64 is a binary-to-text encoding method that uses 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) to represent binary data. It is defined in RFC 4648 and is used extensively for email attachments, data URIs, JWT tokens, HTTP Basic Authentication, and embedding binary data in text-based formats like JSON and XML.

Q: What is TOML and why is it popular?

A: TOML (Tom's Obvious, Minimal Language) is a configuration file format created by Tom Preston-Werner in 2013. It is popular because of its clear, unambiguous syntax that maps directly to hash tables. TOML is the standard configuration format for Rust (Cargo.toml), Python packaging (pyproject.toml), Hugo, Netlify, and many modern development tools.

Q: How does the conversion handle data types?

A: The converter decodes the Base64 content and maps values to appropriate TOML data types. Numeric values become integers or floats, true/false become booleans, date strings become TOML datetime values, arrays become TOML arrays, and nested structures become TOML tables. Strings are properly quoted following TOML conventions.

Q: Can I convert Base64-encoded Kubernetes secrets to TOML?

A: Yes! Kubernetes stores secret data as Base64-encoded values. This converter decodes those values and formats them as a structured TOML configuration file. This is useful for reviewing secret configurations, generating documentation, or migrating settings between different configuration management systems that use TOML.

Q: How are nested structures handled in TOML?

A: Nested data structures are mapped to TOML tables using bracket notation. A top-level key becomes a section header like [server], and nested keys within it become key-value pairs under that section. Deeply nested structures use dotted table headers like [server.ssl]. Arrays of objects use the double-bracket syntax [[items]].

Q: What advantages does TOML have over JSON for configuration?

A: TOML supports comments (JSON does not), has native date-time types, is more readable with its section-based layout, and does not require commas between entries. TOML also has stricter typing rules, preventing common JSON issues like ambiguous number formats. For configuration files that humans need to read and edit, TOML is generally preferred over JSON.

Q: Is the generated TOML specification-compliant?

A: Yes! The output follows the official TOML v1.0.0 specification. All values are properly typed, strings are correctly quoted, tables use valid bracket notation, and arrays follow the specification's formatting rules. The generated file can be parsed by any TOML v1.0 compliant library including Python's tomllib, Rust's toml crate, and Go's BurntSushi/toml.

Q: Can TOML handle multiline strings from decoded Base64?

A: Yes! TOML supports multiline basic strings (triple quotes """ """) and multiline literal strings (triple single quotes ''' '''). When the decoded Base64 content contains long text values, they are formatted using TOML's multiline string syntax for better readability. This preserves line breaks and formatting from the original content.