Skip to content
Run here 100% in your browser, no upload, no login

JS Token Structure

Read JavaScript as a token stream with per-class counts and bracket nesting levels.

Token counts

Result

This is a token-level structural view, not a full AST: there is no scope, binding or type analysis, and the level of nesting comes from bracket depth only.

Regex literals are not detected as a class of their own, and ${} inside a template literal is treated as ordinary text.

How to use it

  1. Paste JavaScript into the input panel - a function, a module or a snippet from devtools.
  2. Press Tokenize. The counts panel shows how many tokens fell into each class.
  3. Switch View to Token list for a flat numbered table: index, nesting depth, class and text.
  4. Switch to Nesting tree to see brackets as containers, so a block reads as a group instead of a flat run of lines.
  5. Load the Sample to see what the output looks like before pasting your own code.

Common use cases

Why it stays private

Tokenizing is character scanning inside this tab. Source code, embedded tokens and proprietary logic never leave your device, so unreleased files are safe to inspect here.

FAQ

Q: Is this a full AST like the one Esprima or Babel produce? A: No. It is a token-level structural view: tokens are classified and nested by bracket depth, but there is no scope, binding or type analysis and no syntax tree nodes.

Q: Why is my regular expression classified as operators? A: Regex literals are not detected as their own class, so the characters inside one are tokenized individually. The limitation is stated on the page rather than hidden.

Q: What happens to ${} inside a template literal? A: The whole template literal is one string token, so an interpolation inside it is treated as ordinary text instead of being parsed as an expression.

Your data stays on this device

JS Token Structure runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.