Compute Field (Free Online Tool)

Create derived values or fields from formulas, expressions, and simple conditionals

Paste your JSON → Get results instantly (no signup)

⚡ Instant resultsNo signupRuns in your browser
Try examples:

Create a derived field by concatenating existing fields.

[
{
"firstName": "Alice",
"lastName": "Smith"
},
{
"firstName": "Bob",
"lastName": "Jones"
}
]
Output
1[
2 {
3 "firstName": "Alice",
4 "lastName": "Smith",
5 "fullName": "Alice Smith"
6 },
7 {
8 "firstName": "Bob",
9 "lastName": "Jones",
10 "fullName": "Bob Jones"
11 }
12]

Love the result?

Use this exact pipeline in your app, backend, or LLM workflow.

No setup needed. Works with curl, Node, Python.

Uses example data. For edited input, copy from the playground.

Read integration guide

Works with:

  • API responses
  • Nested JSON
  • Arrays & objects

Example: input → output

Input / Output
Input
[
{
"firstName": "Alice",
"lastName": "Smith"
},
{
"firstName": "Bob",
"lastName": "Jones"
}
]
Output
[
{
"firstName": "Alice",
"lastName": "Smith",
"fullName": "Alice Smith"
},
{
"firstName": "Bob",
"lastName": "Jones",
"fullName": "Bob Jones"
}
]

Related tools

Advanced usage (optional)

Compute Field

v1.0.0
Convert
objectarray

Description

Compute Field

Create derived fields from expressions — concatenation, math calculations, and conditional logic. Adds a new computed field to each object without modifying existing data.

How It Works

The expression uses {{fieldName}} template syntax to reference fields from each object. The utility evaluates the expression and writes the result to a new field.

String Concatenation

When the expression contains text outside of {{}} references, the result is a string with values interpolated.

"{{firstName}} {{lastName}}" → "Alice Smith"

Math Calculations

When the expression is purely numeric operations on field references, the result is evaluated as a math expression.

"{{price}} * {{quantity}}" → 50

Conditional Logic

Use ternary operators for conditional values.

"{{age}} >= 18 ? \"adult\" : \"minor\"" → "adult"

Configuration

FieldTypeDefaultDescription
Target Pathspath-picker[]Scope to specific objects (empty = apply to root / all items)
Output Field Namestring"computed"Key name for the computed result
Expressionstring""Template with {{fieldName}} references

Expression Syntax

Field References

{{fieldName}}         — top-level field
{{address.city}}      — nested field (dot notation)

String Templates

"{{firstName}} {{lastName}}"              → "Alice Smith"
"Hello, {{name}}!"                        → "Hello, Alice!"
"{{city}}, {{state}} {{zip}}"             → "NYC, NY 10001"

Math Operations

"{{price}} * {{quantity}}"                → 50
"{{total}} - {{discount}}"               → 85
"({{width}} + {{height}}) * 2"           → 30

Conditional Expressions

"{{age}} >= 18 ? \"adult\" : \"minor\""   → "adult"
"{{score}} > 90 ? \"A\" : \"B\""          → "A"
"{{stock}} > 0 ? \"available\" : \"out\"" → "available"

Use Cases

Data Enrichment

  • Full names: Combine first and last name fields
  • Display addresses: Concatenate city, state, zip into a single line
  • Labels: Generate display labels from multiple fields

Calculations

  • Line totals: Multiply price by quantity
  • Discounts: Calculate discounted prices
  • Percentages: Compute ratios between fields

Classification

  • Age groups: Categorize by age ranges
  • Grade letters: Map numeric scores to letter grades
  • Status flags: Derive status from threshold values

Configuration

NameTypeDefaultDescription
Target Pathspath-picker[]Scope to specific objects (empty = apply to root / all items)
Output Field NamestringcomputedKey name for the computed result
ExpressionexpressionTemplate with {{fieldName}} refs. Refs resolve at the FIRST object in the walk where they're found — that's also where the computed field lands. String: "{{firstName}} {{lastName}}" Math: "{{price}} * {{quantity}}" Conditional: "{{age}} >= 18 ? \"adult\" : \"minor\"" Nested ref: "{{payments.0.amount}}" — lifts a value from a nested array/object up to its parent record (numeric segments index arrays).

Examples

AI Prompt
Create a derived field by concatenating existing fields.
[
{
"firstName": "Alice",
"lastName": "Smith"
},
{
"firstName": "Bob",
"lastName": "Jones"
}
]
Output
1[
2 {
3 "firstName": "Alice",
4 "lastName": "Smith",
5 "fullName": "Alice Smith"
6 },
7 {
8 "firstName": "Bob",
9 "lastName": "Jones",
10 "fullName": "Bob Jones"
11 }
12]
Config
Target Paths
all
Output Field Name
fullName
Expression
{{firstName}} {{lastName}}

API Usage

POST /api/v1/utilities/convert.compute
Example:
curl -X POST https://your-domain.com/api/v1/utilities/convert.compute \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs":{"primary":[{"firstName":"Alice","lastName":"Smith"},{"firstName":"Bob","lastName":"Jones"}]},"config":{"targetPaths":[],"targetField":"fullName","expression":"{{firstName}} {{lastName}}"}}'
Response
1[
2 {
3 "firstName": "Alice",
4 "lastName": "Smith",
5 "fullName": "Alice Smith"
6 },
7 {
8 "firstName": "Bob",
9 "lastName": "Jones",
10 "fullName": "Bob Jones"
11 }
12]