RabbitJsonHelp & reference
← JSON to Text Converter
QUICK START

JSON Paths & Template Expressions Guide

Learn how to extract arrays from JSON and convert each item into formatted text. Follow the examples below, then try them in RabbitJson.

1

Extract an array

Paste JSON and enter a path such as data.books. The selected items appear in Extracted Array. For a root-level array, use $.

2

Transform into text

Write a template such as ${name}. Review the Transformation Result, then choose Copy. To try sample data, choose Load example in the workspace.

Conversion modes

Realtime

The array and text update automatically as you edit.

Manual

Choose Extract array, then enter a template and choose Transform text. You can extract without a template.

When inputs change

Editing the template keeps the extracted array. Editing JSON or the path requires another extraction in Manual mode. Old results are cleared to prevent copying outdated text.

Working with large JSON

Large input uses plain text without line numbers. All data is still processed. Outputs preview up to 200 lines or 12,000 characters and may end mid-item. Copy or Download includes the complete result.

Drafts stay in the current tab. If saving fails, keep the page open or save your input elsewhere before refreshing. Switching languages keeps your draft when browser storage is available.

Extract JSON arrays with path expressions

Use dots for fields and brackets for indexes: data.books or items[0].tags. Keys containing dots or spaces need quoted brackets, such as data["book.list"]. Use $ for a root array. The final value must be an array.

Suggestions only include paths that return arrays. Use Up and Down to choose, Tab or Enter to insert, and Escape to dismiss.

EXAMPLE 1

Simple property

Select an array at the top level.

JSON Input

{
  "books": [
    {
      "name": "Book A",
      "price": 10
    },
    {
      "name": "Book B",
      "price": 20
    }
  ]
}

Path Expression

books

Extracted Array

[
  {
    "name": "Book A",
    "price": 10
  },
  {
    "name": "Book B",
    "price": 20
  }
]
EXAMPLE 2

Nested path

Use a dot to move into an object.

JSON Input

{
  "data": {
    "books": [
      {
        "name": "Book A",
        "price": 10
      },
      {
        "name": "Book B",
        "price": 20
      }
    ]
  }
}

Path Expression

data.books

Extracted Array

[
  {
    "name": "Book A",
    "price": 10
  },
  {
    "name": "Book B",
    "price": 20
  }
]
EXAMPLE 3

Array index

Indexes start at zero.

JSON Input

{
  "items": [
    {
      "id": 1,
      "tags": [
        "a",
        "b"
      ]
    },
    {
      "id": 2,
      "tags": [
        "c",
        "d"
      ]
    }
  ]
}

Path Expression

items[0].tags

Extracted Array

[
  "a",
  "b"
]

Convert JSON array items to text with templates

Wrap a field or expression in ${…}. Type inside the braces for field suggestions.

Everything outside ${…} stays as plain text. Each item produces a result joined with a new line. Suggestions support nested fields and show availability across items.

Inside a template expression, use Up and Down to choose a field, Tab or Enter to insert, and Escape to dismiss.

Current item and index

${$item} is the current element; ${$index} starts at 0. Use ${$index + 1} to number from 1. Fields support ${name} and ${$item.name}. Reserved keys use ${$item["$item"]} or ${$item["$index"]}. Use ${JSON.stringify($item)} to output an entire object as JSON.

EXAMPLE 1

JSON array to a Markdown list

For this root-level array, set Path Expression to $. Apply the template to produce one Markdown bullet per item, then copy the result.

Extracted Array

[
  {
    "name": "Alice"
  },
  {
    "name": "Bob"
  }
]

Template String

- ${name}

Transformation Result

- Alice
- Bob
EXAMPLE 2

String arrays

Use $item for the current string and $index + 1 for numbering.

Extracted Array

[
  "admin",
  "editor"
]

Template String

${$index + 1}. Role: ${$item}

Transformation Result

1. Role: admin
2. Role: editor
EXAMPLE 3

Number arrays

Use the current number directly in calculations.

Extracted Array

[
  10,
  20,
  30
]

Template String

${$item} × 2 = ${$item * 2}

Transformation Result

10 × 2 = 20
20 × 2 = 40
30 × 2 = 60
EXAMPLE 4

Object arrays

Access object fields through $item or use the existing field shorthand.

Extracted Array

[
  {
    "name": "Alice"
  },
  {
    "name": "Bob"
  }
]

Template String

${$index + 1}. ${$item.name} / ${name}

Transformation Result

1. Alice / Alice
2. Bob / Bob
EXAMPLE 5

Variable substitution

Insert a field from each array item.

Extracted Array

[
  {
    "name": "Book A",
    "author": "Author 1"
  },
  {
    "name": "Book B",
    "author": "Author 2"
  }
]

Template String

Book: ${name} by ${author}

Transformation Result

Book: Book A by Author 1
Book: Book B by Author 2
EXAMPLE 6

Math operations

Calculate a value inside an expression.

Extracted Array

[
  {
    "name": "Product A",
    "price": 100
  },
  {
    "name": "Product B",
    "price": 200
  }
]

Template String

${name}: $${price} (with tax: $${(price * 1.1).toFixed(2)})

Transformation Result

Product A: $100 (with tax: $110.00)
Product B: $200 (with tax: $220.00)
EXAMPLE 7

Combined expressions

Combine fields, calculations and plain text.

Extracted Array

[
  {
    "item": "Item A",
    "price": 100,
    "qty": 2
  },
  {
    "item": "Item B",
    "price": 50,
    "qty": 3
  }
]

Template String

${item}: ${qty} x $${price} = $${price * qty}

Transformation Result

Item A: 2 x $100 = $200
Item B: 3 x $50 = $150
Check field names and number formatting

Blue marks built-in variables and matching fields, purple marks delimiters, orange marks operators, and teal marks numbers. A red wavy underline marks missing fields. Use toFixed(2) for two decimal places.