JSON to YAML converter

Paste JSON and get YAML ready for Docker Compose, Kubernetes or GitHub Actions files. The conversion runs in your browser and never sends your data to a server.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter json text, indentation and sort keys alphabetically.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The JSON is read per RFC 8259, then every object becomes "key: value" lines and every array becomes lines starting with a dash. Any string that could be read as a number, boolean, null or date is quoted, and multi-line text becomes a | block with the - or + chomping indicator so it reads back unchanged.

Example

Inputs: Indentation = 2 spaces, Sort keys alphabetically = no. Result: YAML: app: toolsahla version: "2.1.0" port: 8080 debug: false languages: - ar - en database: host: localhost user: admin timeout: 30 .

{
  "app": "toolsahla",
  "version": "2.1.0",
  "port": 8080,
  "debug": false,
  "languages": ["ar", "en"],
  "database": {
    "host": "localhost",
    "user": "admin",
    "timeout": 30
  }
}
app: toolsahla
version: "2.1.0"
port: 8080
debug: false
languages:
  - ar
  - en
database:
  host: localhost
  user: admin
  timeout: 30

Limits and caveats

  • Key order follows the JSON unless you choose alphabetical sorting.
  • JSON does not tell 1 from 1.0, so both are written as 1.

Questions about this tool

Why are "yes" and "01234" in quotes?

Some YAML readers treat yes as a boolean and 01234 as a number. Quoting keeps them as text in every reader.

Does it handle Arabic text?

Yes. Arabic letters are written as they are, since YAML is UTF-8.

Is the output valid for Kubernetes files?

Yes, it is standard YAML indented with spaces only. Just make sure the JSON structure matches what the file expects.