Back to Tools

Stack Trace Formatter

Make ugly stack traces readable by highlighting files, lines, and exceptions.

Input Data

Find the failing frame in a long stack trace

A stack trace tells you exactly where a program went wrong, but in a raw paste the useful parts, the exception name and the file and line, drown in package names. This tool prints the trace line by line and colours the three things you look for: the exception type, the source location and the at or in prefix on each frame.

Using the formatter

  1. Paste the trace into Input Data. The placeholder mentions Java, PHP or JS traces. Sample loads a short NullPointerException, and Clear empties the box.
  2. Click Process Now. If the box is empty you will be asked to enter a stack trace.
  3. Read the formatted lines in the results panel.
  4. Use Copy or Download to keep the text; the file is saved as result.txt.

What is highlighted

  • The first token on a line ending in Exception or Error, optionally followed by a colon, is shown in bold red. That covers names such as java.lang.NullPointerException, TypeError and RuntimeException.
  • Locations in the form (MyClass.java:123) or (Script.php:45), and Unix-style paths ending in :line:column, which is how Node.js and browsers print frames, appear in bold green.
  • A leading at or in on a frame is greyed, so the frames stand apart from the message.

Angle brackets in the text are escaped first, so generic types like List<String> or anonymous function markers display correctly instead of being swallowed as HTML.

When it saves time

  • Reading a Java exception pasted from a server console or a CI job.
  • Sharing a cleaner PHP error trace in a code review discussion.
  • Spotting the application frame among many framework frames in a Node.js error.
  • Reviewing a Caused by chain, since every line that includes an exception name gets its own highlight.

Limitations

The tool is pattern based and does not understand the language, so it cannot tell which frame is the root cause or shorten framework noise. Only the first exception name on a line is coloured. Locations from Python, Ruby or .NET traces, and Windows paths with drive letters in a JavaScript trace, do not match the file patterns and stay plain, although the exception names may still be coloured. Nothing is reordered or removed. The output copied or downloaded is plain text without colour, and everything runs in your browser.


Related Tools

Related Tools


Frequently Asked Questions

Which languages does it support?
It is designed for Java, PHP and JavaScript traces. Java and PHP locations in parentheses, such as (File.java:12), and JavaScript style paths ending in :line:column are highlighted. Traces from other languages may only get exception-name colouring where the name ends in Exception or Error.
Does it identify the root cause of the error?
No. It only highlights patterns. You still need to read the trace, typically starting with the exception message and the first frame in your own code. The colours are meant to make that reading faster.
Will it shorten or reorder the trace?
No. Every line you paste is shown in the same order with its text unchanged, and only colour is added. Framework frames are not collapsed or hidden, so long traces stay just as long as before.
Why is the file path not highlighted in my trace?
Only three shapes are matched: (name.java:number), (name.php:number) and Unix-style paths ending in :line:column. Windows drive-letter paths and other formats are left plain. The text is still present, just without the green colour.
Are the colours kept when I copy the result?
No. Copy and Download take the plain text of the result, so you get the trace without any highlighting. The colours are for reading on the page only, so paste into a chat or ticket as text.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.