JMESPath to CSV Converter
Query JSON data with JMESPath and instantly export results to CSV format. Perfect for AWS CLI outputs, API responses, and spreadsheet-friendly reports.
Input JSON
Live evaluationCSV export options
CSV preview (first 5 rows)
| value | index |
|---|---|
| Alice | 0 |
| Carol | 1 |
Why this tool exists
JMESPath doesn't natively support CSV. This tool bridges the gap.
AWS CLI users often search for "jmespath create csv" because they need spreadsheet-friendly results. Instead of chaining jq, sed, and manual scripts, write one JMESPath query, preview the CSV, and download immediately.
Traditional path ❌
- Run AWS CLI to get JSON
- Install jq and craft filters
- Pipe and debug shell quoting
- Manually save CSV
- Hope spreadsheets open correctly
Our path ✅
- Paste AWS CLI JSON
- Write JMESPath query
- Preview CSV columns
- Click "Export to CSV"
- Open in Excel/Sheets instantly
10 AWS CLI scenarios ready to try
Realistic JSON outputs plus JMESPath expressions you can load directly into the converter. Click “Try this example” to prefill the tool and export CSV.
EC2 instance inventory
aws ec2 describe-instances --region us-east-1
Flattens Reservations and Instances, then projects only the columns needed for reporting.
View JSON output
{
"Reservations": [
{
"ReservationId": "r-0123abcd",
"Instances": [
{
"InstanceId": "i-0abc1234def567890",
"InstanceType": "t3.micro",
"LaunchTime": "2024-12-05T14:03:21+00:00",
"PrivateIpAddress": "10.0.1.12",
"State": { "Name": "running" },
"Tags": [
{ "Key": "Name", "Value": "app-server-1" },
{ "Key": "Env", "Value": "prod" }
]
},
{
"InstanceId": "i-0ffedcba987654321",
"InstanceType": "m6g.large",
"LaunchTime": "2024-11-01T09:14:10+00:00",
"PrivateIpAddress": "10.0.2.7",
"State": { "Name": "stopped" },
"Tags": [
{ "Key": "Name", "Value": "batch-worker" },
{ "Key": "Env", "Value": "staging" }
]
}
]
}
]
}JMESPath
Reservations[].Instances[].{InstanceId: InstanceId, Type: InstanceType, State: State.Name, LaunchTime: LaunchTime, PrivateIP: PrivateIpAddress}CSV preview
| InstanceId | Type | State | LaunchTime | PrivateIP |
|---|---|---|---|---|
| i-0abc1234def567890 | t3.micro | running | 2024-12-05T14:03:21+00:00 | 10.0.1.12 |
| i-0ffedcba987654321 | m6g.large | stopped | 2024-11-01T09:14:10+00:00 | 10.0.2.7 |
S3 bucket list
aws s3api list-buckets
Lists bucket names with creation dates. Region can be joined from a separate call.
View JSON output
{
"Buckets": [
{ "Name": "data-lake-prod", "CreationDate": "2023-08-15T12:00:00.000Z" },
{ "Name": "cdn-assets", "CreationDate": "2022-04-03T09:22:10.000Z" },
{ "Name": "backup-logs", "CreationDate": "2024-01-19T18:44:29.000Z" }
],
"Owner": { "DisplayName": "example-account", "ID": "123456789012" }
}JMESPath
Buckets[].{Name: Name, CreationDate: CreationDate}CSV preview
| Name | CreationDate |
|---|---|
| data-lake-prod | 2023-08-15T12:00:00.000Z |
| cdn-assets | 2022-04-03T09:22:10.000Z |
| backup-logs | 2024-01-19T18:44:29.000Z |
Lambda functions
aws lambda list-functions --region us-west-2
Creates a concise inventory ready for operations reviews.
View JSON output
{
"Functions": [
{
"FunctionName": "image-resize",
"Runtime": "python3.11",
"MemorySize": 512,
"Timeout": 15,
"LastModified": "2024-12-10T08:11:54.123+0000"
},
{
"FunctionName": "webhook-handler",
"Runtime": "nodejs20.x",
"MemorySize": 256,
"Timeout": 10,
"LastModified": "2024-11-28T17:01:02.987+0000"
}
]
}JMESPath
Functions[].{FunctionName: FunctionName, Runtime: Runtime, MemoryMB: MemorySize, TimeoutSec: Timeout, LastModified: LastModified}CSV preview
| FunctionName | Runtime | MemoryMB | TimeoutSec | LastModified |
|---|---|---|---|---|
| image-resize | python3.11 | 512 | 15 | 2024-12-10T08:11:54.123+0000 |
| webhook-handler | nodejs20.x | 256 | 10 | 2024-11-28T17:01:02.987+0000 |
IAM users
aws iam list-users
Highlights account age and password usage for security audits.
View JSON output
{
"Users": [
{
"UserName": "alice",
"CreateDate": "2022-07-12T10:05:33Z",
"PasswordLastUsed": "2024-12-14T06:20:01Z"
},
{
"UserName": "bob",
"CreateDate": "2023-02-03T18:40:11Z",
"PasswordLastUsed": null
}
]
}JMESPath
Users[].{UserName: UserName, CreateDate: CreateDate, PasswordLastUsed: PasswordLastUsed}CSV preview
| UserName | CreateDate | PasswordLastUsed |
|---|---|---|
| alice | 2022-07-12T10:05:33Z | 2024-12-14T06:20:01Z |
| bob | 2023-02-03T18:40:11Z |
RDS instances
aws rds describe-db-instances --region us-east-1
Summarizes database fleet status and sizes for capacity tracking.
View JSON output
{
"DBInstances": [
{
"DBInstanceIdentifier": "orders-db",
"DBInstanceClass": "db.r6g.large",
"Engine": "aurora-postgresql",
"DBInstanceStatus": "available",
"AllocatedStorage": 100
},
{
"DBInstanceIdentifier": "analytics-db",
"DBInstanceClass": "db.r6g.2xlarge",
"Engine": "aurora-mysql",
"DBInstanceStatus": "modifying",
"AllocatedStorage": 500
}
]
}JMESPath
DBInstances[].{DBInstanceIdentifier: DBInstanceIdentifier, Engine: Engine, Status: DBInstanceStatus, Class: DBInstanceClass, AllocatedStorage: AllocatedStorage}CSV preview
| DBInstanceIdentifier | Engine | Status | Class | AllocatedStorage |
|---|---|---|---|---|
| orders-db | aurora-postgresql | available | db.r6g.large | 100 |
| analytics-db | aurora-mysql | modifying | db.r6g.2xlarge | 500 |
CloudFormation stacks
aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE
Produces a clean list of stacks and their states for governance.
View JSON output
{
"StackSummaries": [
{
"StackName": "networking",
"CreationTime": "2023-06-01T12:00:00Z",
"StackStatus": "CREATE_COMPLETE"
},
{
"StackName": "payments",
"CreationTime": "2024-02-10T08:30:00Z",
"StackStatus": "UPDATE_COMPLETE"
}
]
}JMESPath
StackSummaries[].{StackName: StackName, Status: StackStatus, CreationTime: CreationTime}CSV preview
| StackName | Status | CreationTime |
|---|---|---|
| networking | CREATE_COMPLETE | 2023-06-01T12:00:00Z |
| payments | UPDATE_COMPLETE | 2024-02-10T08:30:00Z |
ECS tasks
aws ecs list-tasks --cluster prod-cluster && aws ecs describe-tasks --cluster prod-cluster --tasks <ids>
Extracts the essentials for task health dashboards.
View JSON output
{
"tasks": [
{
"taskArn": "arn:aws:ecs:us-east-1:123456789012:task/prod-cluster/1111",
"lastStatus": "RUNNING",
"clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/prod-cluster"
},
{
"taskArn": "arn:aws:ecs:us-east-1:123456789012:task/prod-cluster/2222",
"lastStatus": "PENDING",
"clusterArn": "arn:aws:ecs:us-east-1:123456789012:cluster/prod-cluster"
}
]
}JMESPath
tasks[].{TaskArn: taskArn, ClusterArn: clusterArn, LastStatus: lastStatus}CSV preview
| TaskArn | ClusterArn | LastStatus |
|---|---|---|
| arn:aws:ecs:us-east-1:123456789012:task/prod-cluster/1111 | arn:aws:ecs:us-east-1:123456789012:cluster/prod-cluster | RUNNING |
| arn:aws:ecs:us-east-1:123456789012:task/prod-cluster/2222 | arn:aws:ecs:us-east-1:123456789012:cluster/prod-cluster | PENDING |
VPC list
aws ec2 describe-vpcs
Adds tag-based names to the VPC list to make reports readable.
View JSON output
{
"Vpcs": [
{
"VpcId": "vpc-0abc1234",
"CidrBlock": "10.0.0.0/16",
"State": "available",
"Tags": [{ "Key": "Name", "Value": "core" }]
},
{
"VpcId": "vpc-0def5678",
"CidrBlock": "172.31.0.0/16",
"State": "available",
"Tags": [{ "Key": "Name", "Value": "shared-services" }]
}
]
}JMESPath
Vpcs[].{VpcId: VpcId, CidrBlock: CidrBlock, State: State, Name: Tags[?Key=='Name'].Value | [0]}CSV preview
| VpcId | CidrBlock | State | Name |
|---|---|---|---|
| vpc-0abc1234 | 10.0.0.0/16 | available | core |
| vpc-0def5678 | 172.31.0.0/16 | available | shared-services |
Security groups
aws ec2 describe-security-groups --region us-west-2
Surfaces inbound rules in a compact structure to scan open access quickly.
View JSON output
{
"SecurityGroups": [
{
"GroupId": "sg-0123abcd",
"GroupName": "web-frontend",
"VpcId": "vpc-0abc1234",
"IpPermissions": [
{
"IpProtocol": "tcp",
"FromPort": 443,
"ToPort": 443,
"IpRanges": [{ "CidrIp": "0.0.0.0/0" }]
}
]
},
{
"GroupId": "sg-0fedcba9",
"GroupName": "db",
"VpcId": "vpc-0abc1234",
"IpPermissions": [
{
"IpProtocol": "tcp",
"FromPort": 5432,
"ToPort": 5432,
"IpRanges": [{ "CidrIp": "10.0.0.0/16" }]
}
]
}
]
}JMESPath
SecurityGroups[].{GroupId: GroupId, GroupName: GroupName, VpcId: VpcId, InboundRules: IpPermissions[].{Protocol: IpProtocol, FromPort: FromPort, ToPort: ToPort, Source: IpRanges[].CidrIp | [0]}}CSV preview
| GroupId | GroupName | VpcId | InboundRules |
|---|---|---|---|
| sg-0123abcd | web-frontend | vpc-0abc1234 | [{"Protocol":"tcp","FromPort":443,"ToPort":443,"Source":"0.0.0.0/0"}] |
| sg-0fedcba9 | db | vpc-0abc1234 | [{"Protocol":"tcp","FromPort":5432,"ToPort":5432,"Source":"10.0.0.0/16"}] |
CloudWatch alarms
aws cloudwatch describe-alarms --state-value ALARM
Creates an actionable list of active alarms for on-call handoffs.
View JSON output
{
"MetricAlarms": [
{
"AlarmName": "HighCPU",
"StateValue": "ALARM",
"MetricName": "CPUUtilization",
"Namespace": "AWS/EC2"
},
{
"AlarmName": "5xxErrors",
"StateValue": "ALARM",
"MetricName": "5XXError",
"Namespace": "AWS/ApplicationELB"
}
]
}JMESPath
MetricAlarms[].{AlarmName: AlarmName, StateValue: StateValue, MetricName: MetricName, Namespace: Namespace}CSV preview
| AlarmName | StateValue | MetricName | Namespace |
|---|---|---|---|
| HighCPU | ALARM | CPUUtilization | AWS/EC2 |
| 5xxErrors | ALARM | 5XXError | AWS/ApplicationELB |
How to create CSV from JSON using JMESPath
- Paste your JSON data. Use AWS CLI output, API responses, or any structured JSON.
- Write your JMESPath query. Use filters, projections, and functions to shape columns.
- Export to CSV. Adjust delimiter, encoding, and quotes. Preview the first rows before download.
Do's
- Use multi-select hashes like {Name: name, Age: age}
- Filter early to reduce CSV size
- Rename keys for human-friendly headers
- Validate JSON before exporting
Don'ts
- Avoid deeply nested objects—flatten first
- Avoid massive arrays without filtering
- Don't mix inconsistent shapes in one projection
- Don't include secrets or tokens in exports
Automate it
Python (pip install jmespath pandas)
import json
import jmespath
import pandas as pd
with open("input.json") as f:
data = json.load(f)
expr = jmespath.compile("Reservations[].Instances[].{Id: InstanceId, Type: InstanceType}")
rows = expr.search(data)
df = pd.json_normalize(rows)
df.to_csv("jmespath-result.csv", index=False, encoding="utf-8-sig")Bash (npm i -g jmespath)
#!/usr/bin/env bash
set -euo pipefail
aws ec2 describe-instances --region us-east-1 \
| jp 'Reservations[].Instances[].{Id: InstanceId, State: State.Name}' \
| jq -r '(.[0] | keys_unsorted) as $cols | $cols, (.[] | [.[]]) | @csv' \
> jmespath-result.csv
echo "Saved jmespath-result.csv"Which method to choose?
| Method | Steps | Pros | Cons |
|---|---|---|---|
| JMESPath + this CSV tool | Paste JSON → Write expression → Export CSV | No installs, works with AWS CLI output, reusable expressions | Browser-based; huge files may need pre-filtering |
| jq | Install jq → Learn filters → Use @csv | Powerful CLI, streams large data | Requires shell proficiency; harder for teams to share recipes |
| Python pandas | Install pandas → Load JSON → Normalize → Export CSV | Very flexible, good for complex transforms | Heavier dependency, more code to maintain |
| Generic online converters | Upload JSON → Download CSV | Quick for trivial data | No JMESPath filtering, privacy concerns, limited formatting |
FAQ
▶Can I use this for large JSON files?
Yes, but for very large payloads you should filter first with JMESPath to reduce size before exporting. The tool runs in-browser.
▶How do I handle nested arrays in CSV?
Flatten with projections like people[].skills[] or use multi-select hashes {Name: name, Skill: skills[0]} to produce consistent columns.
▶Can I automate this process?
Yes. Use the Python or Bash examples below to run JMESPath and export CSV in scripts or CI pipelines.
▶Is the CSV format compatible with Excel?
Choose UTF-8 with BOM for the broadest compatibility. Tab or comma delimiters both open in Excel and Google Sheets.
▶What if my JSON has inconsistent structure?
Define explicit projections to normalized keys, e.g., {Name: name, Region: region || 'unknown'}. Missing fields will be blank.
▶Can I export multiple files at once?
Use the automation snippets to iterate through inputs and write multiple CSV files; the online tool downloads one file at a time.
▶Does JMESPath natively support CSV?
No. JMESPath is a query language only. This tool bridges the gap so you can convert JSON to CSV without extra scripts.
▶How do I avoid leaking secrets?
Remove sensitive fields in your expression, e.g., {Id: id, Name: name} to exclude tokens or ARNs before download. Everything runs locally in your browser.
Ready to convert your JSON to CSV?
Use JMESPath to shape your data, then export to CSV instantly. Built for AWS CLI, API responses, and spreadsheet workflows.