JSON ⇄ TOML Converter

JSONTOML

Convert between JSON and TOML formats. TOML is commonly used for configuration files.

API Access

Use this tool programmatically via our REST API. Perfect for build pipelines, configuration management, and automated data transformation.

Endpoint

POST https://toolteeno.com/api/json-to-toml

Request Body

{
  "input": "string",           // Required: JSON or TOML string to convert
  "mode": "json-to-toml|toml-to-json" // Required: Conversion direction
}

Example Response (JSON to TOML)

{
  "success": true,
  "mode": "json-to-toml",
  "input": "{\"name\":\"John\",\"age\":30,\"active\":true}",
  "output": "name = \"John\"\nage = 30\nactive = true"
}

Example Response (TOML to JSON)

{
  "success": true,
  "mode": "toml-to-json",
  "input": "name = \"John\"\nage = 30\nactive = true",
  "output": "{\n  \"name\": \"John\",\n  \"age\": 30,\n  \"active\": true\n}"
}

cURL Example

curl -X POST https://toolteeno.com/api/json-to-toml \
  -H "Content-Type: application/json" \
  -d '{
    "input": "{\"database\":{\"server\":\"192.168.1.1\",\"port\":5432}}",
    "mode": "json-to-toml"
  }'

JavaScript/Fetch Example

const configJson = {
  database: {
    server: "192.168.1.1",
    ports: [8001, 8002],
    enabled: true
  }
};

const response = await fetch('https://toolteeno.com/api/json-to-toml', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    input: JSON.stringify(configJson),
    mode: 'json-to-toml'
  })
});

const data = await response.json();
console.log(data.output);
// Output: TOML formatted configuration

Python Example

import requests
import json

config = {
    "app": {
        "name": "MyApp",
        "version": "1.0.0",
        "debug": False
    }
}

response = requests.post(
    'https://toolteeno.com/api/json-to-toml',
    json={
        'input': json.dumps(config),
        'mode': 'json-to-toml'
    }
)

result = response.json()
print(result['output'])
# Output: TOML configuration

Common Use Cases

  • Converting configuration files between formats
  • Migrating from JSON to TOML configs (Cargo, Rust, etc.)
  • API response transformation
  • Configuration file generation in build pipelines
  • Data format conversion for different tools and frameworks

Format Support: Handles nested objects, arrays, strings, numbers, booleans, and null values in both directions.

This API is completely free to use with no rate limits or authentication required!