JSON Truncator

Truncate large JSON to a manageable size. Limit by depth, keys per object, array length, and string length. Perfect for debugging huge API responses.

Input JSON
Truncated JSON

Features

📐 Depth Limiting

  • Set a maximum nesting depth
  • Deeper objects replaced with {"...": "..."}
  • Deeper arrays replaced with ["..."]
  • Default depth of 3 levels

🔑 Key & Array Limits

  • Keep only first N keys per object
  • Truncate arrays to first N items
  • Appended count of omitted entries
  • Set 0 for unlimited keys

📝 String Truncation

  • Trim long string values
  • Shows remaining character count
  • Configurable length threshold
  • Keeps all other value types intact

JSON Truncation Guide

How Truncation Works

All four truncation modes can be combined. The tool walks the JSON tree and applies each rule at each node:

  • Max depth — any node deeper than this level is replaced with a placeholder value.
  • Max keys — only the first N keys of each object are kept; a "..." key shows how many were omitted.
  • Max array items — only the first N elements of each array are kept; a trailing string item shows the omitted count.
  • Max string length — string values longer than N characters are sliced and appended with a char-count suffix.