Stack Trace Formatter

Format Java, Go, Python and JavaScript stack traces for readability. (Merges site's Stack Trace, Java Exception and Go stacktrace tools.)

The Stack Trace Formatter takes a raw stack trace from Java, Go, Python or JavaScript and prints it as a compact list of frames. It can hide runs of framework frames so your own code stands out. It tells you how many frames it found and how many it hid.

What is a stack trace?

A stack trace is a snapshot of the call stack at the moment an error or panic occurred. Each frame names a function and, usually, the file and line where it was executing. Reading one means working from the error line to the first frame in your own code. Real traces are noisy, because frameworks, runtimes and libraries add dozens of frames between your code and the point of failure. The formats also differ by language: Java uses lines starting with at and parentheses holding file and line, Python prints File lines followed by the source text, JavaScript engines print at function (file:line:col), and Go prints a function line followed by an indented file path with line number. This tool parses each format, keeps non-frame text such as the exception message, and optionally collapses consecutive framework frames into a single line.

How to use Stack Trace Formatter

  1. Paste the trace Put the full stack trace in the Raw stack trace box.
  2. Select the language Choose Java, Go, Python or JavaScript under Language.
  3. Decide on collapsing Leave Collapse framework frames ticked to hide library frames, or untick it to keep every frame.
  4. Read the result Format is the selected operation, so the Formatted box fills in as you type. A message under it gives the frame and hidden counts.

Frequently asked questions

How does it decide what is a framework frame?

It matches package, path or module patterns per language, for example java. and org.springframework. in Java, site-packages in Python and node_modules in JavaScript. It is a heuristic, so your own code is only hidden if it matches those patterns.

Does it support Firefox-style JavaScript traces?

Yes. Lines in the function@file:line:col form used by Firefox and Safari are parsed as well as the V8 at-style lines.

Does it handle chained causes such as Caused by in Java?

Lines that are not frames, such as Caused by: lines, are kept as plain text between frames.

Can it deobfuscate minified or source-mapped traces?

No. It only reformats the text you give it.

Is the trace sent anywhere?

No. It is processed in the page, so file paths and messages stay on your device.