Formats

XML ↔ JSON

Convert between XML and JSON formats.

How to use it

  1. Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type XML ↔ JSON and press Return.
  2. Choose To JSON or To XML at the top.
  3. Paste or type your text into Input.
  4. Adjust the Options on the right if you need to. The defaults are listed below.
  5. Press To JSON, or ⌘↵.
  6. To go the other way, press Swap or ⌘S. The output moves into the input.
  7. Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.

Options

OptionValuesDefault
Indent SpacesNumber of spaces for indentation1–82
Attribute prefixPrefix for XML attributes in JSON@, _, $attr_, none@
Text content keyKey name for text content#text, _text, $value, _#text

Example

Real output from Devly, with the default options.

Input
<app><name>Devly</name><version>2.3.0</version><offline>true</offline></app>
{
  "app" : {
    "name" : "Devly",
    "offline" : "true",
    "version" : "2.3.0"
  }
}

From Terminal

With the free command-line tool installed:

Terminal
devly xml2json --path input.txt
# or pipe text in
pbpaste | devly xml2json

Quick Switch also finds it by: xml, json, convert, transform.

More Formats tools