Tools / Stack Trace Formatter

Stack Trace Formatter.

Clean up JavaScript, PHP, Python, Java and Go stack traces, unescape one-line traces and hide vendor frames.

Runs in your browser

Removed from the start of every file path

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Formatted trace
Summary
Frames

About Stack Trace Formatter

Stack Trace Formatter reads the error traces that runtimes print and lays them out the same way whatever the language: the exception message first, then one "at function (file:line:column)" line per frame. It understands V8 traces from Node.js and Chrome, Firefox's function@file form, PHP's numbered "#0 file(line): call" frames, Python tracebacks with the source line under each frame, Java and Kotlin traces with "Caused by:" and "... 12 more" sections, and Go panics where the function and its file sit on two lines. Traces copied out of a JSON log or an API response often arrive as one long line full of \n escapes; the formatter notices that and unescapes them before parsing. Each frame is classified as app, vendor (node_modules, vendor/, site-packages, Go module cache) or internal (node:internal, the Python standard library, java.* classes, the Go runtime). Turn on hiding and runs of vendor and internal frames collapse into a single "… 4 frames hidden" line, which usually leaves the three or four frames from your own code that matter. Set a path prefix such as /var/www/html/ to shorten every file path. For example, a 60-line Laravel trace typically shrinks to the controller and service frames that caused it. A common mistake is reading a Python traceback top-down: the most recent call is the last frame, and chained exceptions are printed cause first. The summary shows the detected language, frame counts and the first app frame. Nothing is uploaded; the trace is parsed in your browser.

How to Use

  1. Paste the stack trace, either as printed or as an escaped one-line string from a log.
  2. Optionally hide vendor and runtime frames and enter a path prefix to strip.
  3. Copy the formatted trace or check the frames table and summary for the first app frame.

Frequently Asked Questions

Which languages are supported?

JavaScript (V8 and Firefox formats), PHP, Python, Java and other JVM languages, and Go panics. Traces that mix several of these, such as a PHP trace inside a Laravel log, are handled line by line.

What counts as a vendor frame?

Frames from node_modules, a vendor directory, Python site-packages or dist-packages, and the Go module cache. Runtime frames such as node:internal, the Python standard library, java.* classes and the Go runtime are marked internal. Both are hidden by the toggle.

Can it read a trace that was escaped inside JSON?

Yes. If the input has no real line breaks but contains \n sequences, it is unescaped like a JSON string first, so a "stack" field copied from a log works as is.

Is the trace sent to a server?

No. Formatting runs in your browser, so file paths and messages from production stay on your machine.

Related Tools