Hack the Hydra

YAML to JSON converter

Paste YAML and get JSON. Useful when an API, a script or a tool like jq expects JSON but your configuration is written in YAML. If the YAML is invalid, the error message gives the line and column.

🔒 Private by design: the conversion runs in this browser tab. Nothing is uploaded.

YAML to JSON converter is a free online tool by Hack the Hydra. Convert YAML to JSON online: Kubernetes manifests, Docker Compose, GitHub Actions, OpenAPI. Pretty or minified output, multi-document YAML supported, errors shown with line and column. Runs in your browser.

100% freeNo upload: runs in your browserNo sign-up
YAML to JSON converter: the tool with a sample file converted

How values are converted

YAML mappings become JSON objects and sequences become arrays. Unquoted numbers, true, false and null become JSON numbers, booleans and null; anything in quotes stays a string, so DEBUG: "false" gives "false" as text. Dates written as 2026-11-10 become ISO date strings, because JSON has no date type.

Several documents in one file

A YAML file can hold several documents separated by a line with three dashes (---), as in many Kubernetes files. When there is more than one document, the result is a JSON array with one element per document, in order.

What is lost

JSON has no comments, so YAML comments are dropped. Anchors and aliases (&name and *name) are expanded into full copies of the data. Custom tags such as !Ref in CloudFormation are not supported and give an error: the parser only accepts standard YAML types, which is also what keeps it safe.

Example

A small Docker-style config. Quoted "false" stays a string, unquoted numbers stay numbers.

Input

name: web
image: nginx:1.27
ports:
  - 80
  - 443
env:
  DEBUG: "false"
  MODE: prod

Output

{
  "name": "web",
  "image": "nginx:1.27",
  "ports": [
    80,
    443
  ],
  "env": {
    "DEBUG": "false",
    "MODE": "prod"
  }
}

How to use

  1. Type or paste your text in the box above.
  2. The result updates as you type; change the options to switch mode.
  3. Copy the result or download it.

FAQ

Is my YAML uploaded?

No. The YAML is parsed by JavaScript in your browser tab with the open-source js-yaml library, so configs that contain internal names or hostnames never leave your computer.

Why do I get an error about indentation?

YAML uses spaces for structure and does not allow tabs for indentation. Check the line and column in the message: usually an item is indented one space too much or too little.

Does it support CloudFormation tags like !Ref or !Sub?

No. Only standard YAML is accepted. Replace short tags with their full form, for example {"Ref": "MyBucket"}, or use the AWS CLI.

Can I convert JSON back to YAML?

Yes, use the JSON to YAML converter on this site.

Guides

More free converters

PDF to Markdown converterOCR PDF: scanned PDF to textImage to text (OCR)Word (DOCX) to Markdown converterExcel & CSV to Markdown tablesHTML to Markdown converterPowerPoint (PPTX) to Markdown converterJSON to Markdown tablePDF to text converterExcel to JSON converterMarkdown to HTML converterMerge PDF filesSplit PDF: extract pagesRotate PDFJPG to PDF converterPDF to JPG converterImage converter: PNG, JPG, WebPCompress image: JPG and WebPQR code generatorWord counterCase converterJSON formatter and validatorBase64 encode and decodeURL encoder and decoderUUID v4 generatorStrong password generatorLorem ipsum generatorJSON to CSV converterRemove duplicate linesUnix timestamp converterJSON to YAML converterText diff checkerImage resizerPercentage calculatorAge calculatorHash generator (SHA-256, SHA-1, SHA-512)Color converter: HEX, RGB, HSLDays between dates calculatorUnit converterJWT decoderBinary, hex, decimal and octal converterRoman numeral converterRegex testerCron expression explainerPDF to Markdown for ChatGPTPDF to Markdown for ClaudePDF to Markdown for RAG pipelinesPDF to Markdown for ObsidianPDF to Notion (via Markdown)Screenshot to textFrench OCR: image to textCSV to Markdown tableGoogle Docs to MarkdownJPG / JPEG to text (OCR)PNG to text (OCR)CSV to JSON converterPNG to JPG converterJPG to PNG converterWebP to PNG converter