Compute Field (Free Online Tool)
Create derived values or fields from formulas, expressions, and simple conditionals
Paste your JSON → Get results instantly (no signup)
→ Create a derived field by concatenating existing fields.
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.
Works with:
- API responses
- Nested JSON
- Arrays & objects
Example: input → output
Related tools
- CSV to JSONParse CSV text into a JSON array of row objects for further cleanup or reshaping
- XML to JSONParse XML text into JSON for downstream normalization, validation, and reconciliation pipelines
- YAML to JSONParse YAML into JSON for diff, validation, and config-normalization pipelines
- Table JSON to RecordsConvert table-like JSON exports with header and row arrays into normal JSON records
- JSON to CSVConvert JSON array row data into final CSV text output
Advanced usage (optional)
Compute Field
v1.0.0Description
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}}" → 50Conditional Logic
Use ternary operators for conditional values.
"{{age}} >= 18 ? \"adult\" : \"minor\"" → "adult"Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| Target Paths | path-picker | [] | Scope to specific objects (empty = apply to root / all items) |
| Output Field Name | string | "computed" | Key name for the computed result |
| Expression | string | "" | 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" → 30Conditional 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
| Name | Type | Default | Description |
|---|---|---|---|
| Target Paths | path-picker | [] | Scope to specific objects (empty = apply to root / all items) |
| Output Field Name | string | computed | Key name for the computed result |
| Expression | expression | | Template 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
Create a derived field by concatenating existing fields.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]API Usage
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}}"}}'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]