Stack Trace Formatter
Make ugly stack traces readable by highlighting files, lines, and exceptions.
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
- Paste the trace into Input Data. The placeholder mentions Java, PHP or JS traces. Sample loads a short NullPointerException, and Clear empties the box.
- Click Process Now. If the box is empty you will be asked to enter a stack trace.
- Read the formatted lines in the results panel.
- 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