JavaScript Object Explorer
Visualize, navigate, and understand JavaScript objects and JSON — tree view, type detection, path flattening, and code generation
An API returns a deeply nested JSON response — 200 keys across 5 nesting levels. You need the path to a specific field so you can write data.results[0].metadata.author.name. You expand objects in DevTools one level at a time, losing track of where you are. Or you need to generate a TypeScript interface for this response shape, or flatten all paths to dot notation for a data pipeline. You need a tool that shows the full tree structure at once.
Why This Explorer (Not the JS Object Explorer)
PureDevTools has two object explorer tools. This one focuses on developer utilities — expandable tree view, value type annotations, dot-notation path flattening, key search, type filtering, destructuring code generation, and TypeScript interface generation. The JS Object Explorer is a simpler visual inspector. Use this tool when you need to generate code from the structure.
What Is the JavaScript Object Explorer?
The JavaScript Object Explorer is a free browser-based tool that helps you inspect, navigate, and understand JavaScript objects and JSON data. Paste any JSON or JavaScript object literal and instantly see its full structure as an interactive tree — with type annotations, property counts, nesting depth, and clickable dot-notation paths.
Whether you’re debugging a deep API response, exploring an unfamiliar data shape, or generating TypeScript types on the fly, this tool gives you a clear view of your data without writing a single line of code.
Key Features
Interactive tree view — Expand and collapse any nested object or array. Each node shows its key, value type badge, and a value preview for primitives. Property counts keep you oriented in deep hierarchies.
Type detection — Every value is classified as string, number, boolean, null, undefined, array, object, or function. Color-coded badges make types scannable at a glance.
Dot-notation path flattening — Switch to the Paths tab to see every property flattened to its full access path (e.g. user.address.city, user.scores[0]). Useful for writing JSONPath queries, building lodash _.get() calls, or mapping API fields.
Path search and type filter — Search paths by keyword and filter by value type to quickly find the properties you care about.
Copy path on click — Click “Copy path” next to any node to copy its dot/bracket notation path directly to your clipboard.
Destructuring code generator — The Code tab generates a JavaScript destructuring assignment from any object’s top-level keys, saving you from typing them out manually.
TypeScript interface generator — Infers TypeScript type declarations from the object structure, including nested objects, arrays, primitives, null, and undefined. A quick starting point for hand-writing typed interfaces from real data.
Supported Input Formats
The tool accepts two input formats:
-
JSON — Any valid JSON value: objects
{}, arrays[], strings, numbers, booleans, ornull. Parsed using the standardJSON.parse(). -
JavaScript object literals — Objects with unquoted keys, single-quoted strings, trailing commas, comments,
undefinedvalues, and function expressions. Evaluated safely in the browser using theFunctionconstructor.
Examples of valid JavaScript object literal input:
{
name: 'Alice',
scores: [10, 20, 30],
active: true,
role: undefined,
greet: function() { return 'hello'; }
}
How to Read the Tree View
Each row in the tree represents one property:
- Key (blue) — The property name or array index
- Type badge — Color-coded label showing the value’s runtime type
- Value preview — Shown for primitives; object/array nodes show property count instead
- Expand/collapse toggle — Click
▶or▼to show or hide nested properties - Copy path — Hover over any row to reveal the “Copy path” button
The root node (root) represents the entire input value. The first level below it shows the top-level properties.
Dot-Notation Path Format
Paths use standard JavaScript member access notation:
- Simple key:
user.name - Nested key:
user.address.city - Array index:
user.scores[0] - Key with special characters:
user["first-name"]
These paths can be used directly in:
lodash.get(obj, 'user.address.city')- JSONPath queries:
$.user.address.city - TypeScript optional chaining:
obj?.user?.address?.city
TypeScript Interface Generation
The Code tab generates a TypeScript interface inferred from the object’s shape. Types are mapped as follows:
| JavaScript type | TypeScript type |
|---|---|
string | string |
number | number |
boolean | boolean |
null | null |
undefined | undefined |
object | Nested interface block |
array | Element type [] |
function | (...args: unknown[]) => unknown |
The generated interface is a structural starting point. Review it before use — real APIs often require optional (?) properties and union types that can’t be inferred from a single sample.
Common Use Cases
- Debugging API responses — Quickly see the shape of a JSON payload without logging individual fields
- Writing TypeScript types — Generate a structural interface to refine by hand
- Building JSONPath expressions — Copy the exact path to any property
- Code review — Understand an unfamiliar object passed through a function
- Teaching JavaScript data structures — Visualize how nesting and prototypes work
- Exploring configuration objects — Navigate deeply nested config files or package.json
Privacy
All processing happens entirely in your browser. No data is sent to any server. Your JavaScript objects and JSON are never transmitted or stored.
Frequently Asked Questions
Can I paste a JavaScript object literal with unquoted keys?
Yes. The tool tries JSON.parse() first, then falls back to evaluating the input as a JavaScript expression using the Function constructor. Unquoted keys, single-quoted strings, trailing commas, undefined, and function expressions all work.
What is the maximum nesting depth?
The tool processes up to 20 levels of nesting. Nodes beyond that depth are shown as [max depth reached] to prevent performance issues with circular or extremely deep structures.
Can I explore arrays at the root level?
Yes. Paste a JSON array like [1, 2, {"key": "value"}] and the tree will show each array element as an indexed node ([0], [1], [2]).
Why does the TypeScript interface show null instead of string | null?
The interface is inferred from a single data sample. If a field is null in your sample, its type appears as null. Adjust it to string | null or T | null as needed for your actual schema.
Is this safe for sensitive data like API keys or passwords? The tool runs entirely client-side — no network requests are made. However, as with any browser tool, avoid pasting credentials into browser-based tools as a general practice.