JSONPath Online logojsonpath.online
JMESPath create csv · Built for AWS CLI

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.

⚡ Instant Export🔧 AWS CLI Ready📊 Excel Friendly

Input JSON

Live evaluation

CSV export options

CSV preview (first 5 rows)

valueindex
Alice0
Carol1

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.

Back to JMESPath tester

Traditional path ❌

  1. Run AWS CLI to get JSON
  2. Install jq and craft filters
  3. Pipe and debug shell quoting
  4. Manually save CSV
  5. Hope spreadsheets open correctly

Our path ✅

  1. Paste AWS CLI JSON
  2. Write JMESPath query
  3. Preview CSV columns
  4. Click "Export to CSV"
  5. 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

InstanceIdTypeStateLaunchTimePrivateIP
i-0abc1234def567890t3.microrunning2024-12-05T14:03:21+00:0010.0.1.12
i-0ffedcba987654321m6g.largestopped2024-11-01T09:14:10+00:0010.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

NameCreationDate
data-lake-prod2023-08-15T12:00:00.000Z
cdn-assets2022-04-03T09:22:10.000Z
backup-logs2024-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

FunctionNameRuntimeMemoryMBTimeoutSecLastModified
image-resizepython3.11512152024-12-10T08:11:54.123+0000
webhook-handlernodejs20.x256102024-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

UserNameCreateDatePasswordLastUsed
alice2022-07-12T10:05:33Z2024-12-14T06:20:01Z
bob2023-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

DBInstanceIdentifierEngineStatusClassAllocatedStorage
orders-dbaurora-postgresqlavailabledb.r6g.large100
analytics-dbaurora-mysqlmodifyingdb.r6g.2xlarge500
🧱

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

StackNameStatusCreationTime
networkingCREATE_COMPLETE2023-06-01T12:00:00Z
paymentsUPDATE_COMPLETE2024-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

TaskArnClusterArnLastStatus
arn:aws:ecs:us-east-1:123456789012:task/prod-cluster/1111arn:aws:ecs:us-east-1:123456789012:cluster/prod-clusterRUNNING
arn:aws:ecs:us-east-1:123456789012:task/prod-cluster/2222arn:aws:ecs:us-east-1:123456789012:cluster/prod-clusterPENDING
🌐

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

VpcIdCidrBlockStateName
vpc-0abc123410.0.0.0/16availablecore
vpc-0def5678172.31.0.0/16availableshared-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

GroupIdGroupNameVpcIdInboundRules
sg-0123abcdweb-frontendvpc-0abc1234[{"Protocol":"tcp","FromPort":443,"ToPort":443,"Source":"0.0.0.0/0"}]
sg-0fedcba9dbvpc-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

AlarmNameStateValueMetricNameNamespace
HighCPUALARMCPUUtilizationAWS/EC2
5xxErrorsALARM5XXErrorAWS/ApplicationELB

How to create CSV from JSON using JMESPath

  1. Paste your JSON data. Use AWS CLI output, API responses, or any structured JSON.
  2. Write your JMESPath query. Use filters, projections, and functions to shape columns.
  3. 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?

MethodStepsProsCons
JMESPath + this CSV toolPaste JSON → Write expression → Export CSVNo installs, works with AWS CLI output, reusable expressionsBrowser-based; huge files may need pre-filtering
jqInstall jq → Learn filters → Use @csvPowerful CLI, streams large dataRequires shell proficiency; harder for teams to share recipes
Python pandasInstall pandas → Load JSON → Normalize → Export CSVVery flexible, good for complex transformsHeavier dependency, more code to maintain
Generic online convertersUpload JSON → Download CSVQuick for trivial dataNo 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.