.NET Stack Trace Formatter
Paste a raw .NET stack trace — collapsed, JSON-escaped, or already multi-line — and get a readable formatted version, a ready-to-paste Markdown code block, and a frame-by-frame analysis table with framework frames de-emphasized.
What this tool does
Paste a raw .NET stack trace — however it arrived, whether already multi-line, collapsed onto one line by a log viewer, or JSON-escaped with literal \r\n as copied from an Application Insights export — and this tool re-expands it into readable, consistently indented frames, a ready-to-paste Markdown code block, and a frame-by-frame analysis table that visually separates your own code from framework noise. Everything runs in your Blazor Server session; nothing is sent to an external API.
Before and after
A trace as it typically appears in a Docker log line or a JSON field:
System.NullReferenceException: Object reference not set to an instance of an object.\r\n at MyApp.Services.OrderService.CalculateTotal(Order order) in C:\\src\\MyApp\\OrderService.cs:line 42\r\n at MyApp.Controllers.OrderController.Post(OrderDto dto) in C:\\src\\MyApp\\OrderController.cs:line 18
becomes:
System.NullReferenceException: Object reference not set to an instance of an object.
at MyApp.Services.OrderService.CalculateTotal(Order order) in C:\src\MyApp\OrderService.cs:line 42
at MyApp.Controllers.OrderController.Post(OrderDto dto) in C:\src\MyApp\OrderController.cs:line 18
Reading a .NET stack trace
Frames are listed with the most recent call first — the top frame is where the exception was actually thrown; the bottom frame is closest to the entry point (your Main, a controller action, or a middleware pipeline). When you see a <MethodName>d__N.MoveNext() frame, that's not a bug in your code — it's the compiler-generated state machine class backing an async method. TaskAwaiter frames and --- End of stack trace from previous location where exception was thrown --- markers are part of the same mechanism: .NET's async infrastructure unwinding through awaited continuations rather than a literal synchronous call chain. This tool labels those frames explicitly instead of treating them as unrecognized noise.
An inner exception section (introduced by ---> and closed by --- End of inner exception stack trace ---) means the exception you're looking at wraps an earlier, more specific cause — read the innermost exception first; it's usually the real root cause, and everything above it is where that cause got caught, wrapped, and rethrown.
How to use this tool
- Paste the raw trace — any layout works.
- Click Format (or Ctrl+Enter).
- Switch between the Formatted and Markdown tabs; copy whichever you need.
- Toggle Hide framework frames to focus on just your own code in both the output and the frame analysis table below it.
Whether you need to format exception stack trace text pulled from a log aggregator or just read C# stack trace output someone pasted into a chat message, this works as a plain .NET stack trace reader too — paste an already-clean, multi-line trace and it still gets the frame analysis and framework-frame de-emphasis.
Raw stack trace
System.InvalidOperationException: Failed to process order ---> System.ArgumentNullException: Value cannot be null. (Parameter 'customerId') at MyApp.Services.OrderService.Validate(String customerId) in C:\src\MyApp\Services\OrderService.cs:line 22 at MyApp.Services.OrderService.<CalculateTotalAsync>d__5.MoveNext() in C:\src\MyApp\Services\OrderService.cs:line 40 --- End of inner exception stack trace --- at MyApp.Services.OrderService.<CalculateTotalAsync>d__5.MoveNext() in C:\src\MyApp\Services\OrderService.cs:line 45 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at MyApp.Controllers.OrderController.Post(OrderDto dto) in C:\src\MyApp\Controllers\OrderController.cs:line 18
Formatted stack trace
Formatted output
System.InvalidOperationException: Failed to process order ---> System.ArgumentNullException: Value cannot be null. (Parameter 'customerId') at MyApp.Services.OrderService.Validate(String customerId) in C:\src\MyApp\Services\OrderService.cs:line 22 at MyApp.Services.OrderService.<CalculateTotalAsync>d__5.MoveNext() in C:\src\MyApp\Services\OrderService.cs:line 40 --- End of inner exception stack trace --- at MyApp.Services.OrderService.<CalculateTotalAsync>d__5.MoveNext() in C:\src\MyApp\Services\OrderService.cs:line 45 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at MyApp.Controllers.OrderController.Post(OrderDto dto) in C:\src\MyApp\Controllers\OrderController.cs:line 18
Frame analysis
| # | Method | Type | File / Line |
|---|---|---|---|
| System.InvalidOperationException: Failed to process order | |||
| ---> System.ArgumentNullException: Value cannot be null. (Parameter 'customerId') | |||
| 1 | Validate(String customerId) | MyApp.Services.OrderService | C:\src\MyApp\Services\OrderService.cs:22 |
| 2 | MoveNext() | MyApp.Services.OrderService.<CalculateTotalAsync>d__5 | C:\src\MyApp\Services\OrderService.cs:40 |
| --- End of inner exception stack trace --- | |||
| 3 | MoveNext() | MyApp.Services.OrderService.<CalculateTotalAsync>d__5 | C:\src\MyApp\Services\OrderService.cs:45 |
| --- End of stack trace from previous location where exception was thrown --- | |||
| 4 | ThrowForNonSuccess(Task task) | System.Runtime.CompilerServices.TaskAwaiter | — |
| 5 | Post(OrderDto dto) | MyApp.Controllers.OrderController | C:\src\MyApp\Controllers\OrderController.cs:18 |