JSON to YAML and Properties Converter

Convert JSON or XML to YAML, or move Spring Boot settings between application.properties and application.yml.

Editor (Formatted View)
1
Ready — paste or type JSON / XML / Properties here
Viewer
Converted output will appear here
Ready

What you can convert here

ButtonFrom → To
Convert to YAMLJSON or XML → YAML
Property to YAMLkey=value lines from a .properties file → nested YAML
YAML to PropertyNested YAML → flat key=value lines

Spring Boot: application.properties to application.yml

Spring Boot reads both files the same way. Dotted keys in a properties file turn into nested blocks in YAML:

server.port=8080
spring.datasource.url=jdbc:postgresql://localhost/app
spring.datasource.username=app

becomes

spring:
  datasource:
    username: app
    url: jdbc:postgresql://localhost/app
server:
  port: 8080

The order of keys can change along the way. Spring doesn't care about order, but reorder by hand if you want the file to read top-down. Comments in the properties file are not carried over.

Going the other way, lists become numbered keys: a YAML list under hosts: turns into hosts[0]=… and hosts[1]=…, which is the form Spring expects in a properties file.

Why some keys get quotes

Convert {"country": "no", "y": 2, "on": true} and you'll get:

country: "no"
"y": 2
"on": true

The quotes are deliberate. Older YAML parsers read words like y, n, yes, no, on and off as true or false. Without the quotes, the country code for Norway would turn into false. Quoting keeps them as plain text in every parser.

YAML indentation in short

Frequently asked questions

Is JSON valid YAML?

Yes. YAML 1.2 is a superset of JSON, so any JSON document is also valid YAML. That is also why converting JSON to YAML never loses data. The reverse isn't true: YAML has comments, anchors and multiple documents per file, which JSON can't express.

Should I use application.properties or application.yml?

Both behave the same at runtime. YAML is easier to read when many settings share a prefix. Properties files are easier to override one line at a time and to search with grep.

Does the converter keep comments?

No. JSON has no comments to begin with, and comments in a properties file are dropped during conversion. Add them back to the YAML by hand if you need them.

Other tools

Share Content

Choose what to share and generate an instant link

🔥 One-time link Content deleted from server after first view
✉️
Uploading to server…