Convert JTL to CSV
How JTL to CSV conversion works for JMeter results, what changes when XML results are flattened, when a JTL is already CSV, and when to keep the original file.
A JTL file is most often a results log from Apache JMeter, the open-source load testing tool. Converting one to CSV is usually about getting test results into a spreadsheet, a database, or a reporting script. Whether that conversion is trivial, lossy, or unnecessary depends on which format the JTL file already uses. This review covers what the conversion changes, what it can lose, and when the original file is the better thing to keep.
Which kind of JTL file you have
The extension is ambiguous, so check the file before choosing a method. In JMeter, .jtl is a naming convention, not a single format. The file can hold either comma-separated text or XML, depending on the jmeter.save.saveservice.output_format setting in effect when the test ran. In current JMeter releases the default is CSV. The same three letters also appear in other contexts, such as exports from the JTL-Wawi merchandise management software. Those are separate products with separate formats. This article covers JMeter results only.
The quickest check is to open the file in a plain text editor. If the first line is a list of field names separated by commas, or the lines are rows of comma-separated values, the file is already CSV. If it starts with an XML declaration and a testResults element, it is XML and needs real conversion.
Illustrative CSV-format JTL (header line, then one sample row; values are examples, not measurements):
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1700000000000,245,Login,200,OK,Thread Group 1-1,text,true,,1532,410,1,1,https://example.test/login,240,0,12
Illustrative XML-format JTL (values are examples, not measurements):
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<httpSample t="245" it="0" lt="240" ct="12" ts="1700000000000" s="true" lb="Login" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="1532" sby="410" ng="1" na="1"/>
</testResults>
Is converting JTL to CSV suitable for your use?
For most analysis work, yes. CSV is the format spreadsheets, data tools and JMeter's own HTML dashboard generator expect, and one row per sample makes filtering and charting easy. The tradeoff is structure. XML results can hold nested sub-samples, per-assertion results, request and response headers, and response bodies. A flat CSV table either drops these or squeezes them into single cells.
- Convert, or switch to CSV output, when you need per-request timings, status codes and error flags for spreadsheets, scripts or the JMeter HTML report.
- Keep the XML original as well when you need the parent and child relationship of transaction controllers or embedded resources, assertion detail, or saved response data for debugging.
- If the file is already CSV, you do not need a converter. Renaming it, or opening it directly, is enough.
What the conversion actually changes
When the source is a CSV-format JTL, converting it changes nothing in the content. The bytes are identical, and only the extension or the program associated with the file differs.
When the source is XML, conversion reshapes the data. Each sample element becomes a row, and each attribute becomes a column. The short XML attribute names map to the longer CSV header names. For example, t maps to elapsed, lt to Latency, ts to timeStamp, s to success, lb to label, rc to responseCode, and by to bytes. Nested elements need a decision. Sub-samples can be flattened into their own rows, which loses the visible link to their parent unless a column records it, or they can be omitted. Assertion results and response data are usually dropped or reduced to a failure message.
| XML attribute | CSV column | Meaning |
| ts | timeStamp | Sample start time, in milliseconds since the Unix epoch |
| t | elapsed | Total sample time in milliseconds |
| lt | Latency | Time to first response byte in milliseconds |
| ct | Connect | Connection time in milliseconds |
| s | success | true or false |
| lb | label | Sampler name |
| rc | responseCode | Response code, such as 200 or a non-HTTP error text |
| rm | responseMessage | Response message |
| tn | threadName | Thread that ran the sample |
| by | bytes | Bytes received |
| sby | sentBytes | Bytes sent |
| ng / na | grpThreads / allThreads | Active threads in the group / in all groups |
The exact column set is not fixed. The jmeter.save.saveservice.* properties decide which fields were saved. A converted file can only contain fields that were recorded during the test. Conversion cannot recover a field such as Connect if it was turned off at run time.
Common ways to do the conversion
Fix the format at the source for future runs. Set these properties in user.properties, or pass them with -J on the command line, so results are written as CSV with a header row:
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.print_field_names=true
For an existing XML file, there are three common routes. The first is to load it into a JMeter listener, such as View Results in Table or Simple Data Writer, with CSV output configured, then save it again. The second is the command-line tool from the JMeter Plugins project, which has a --generate-csv option. That tool exports the data behind a chosen report type, so check whether the output contains raw samples or aggregated statistics before relying on it. The third is a short script or XSLT transform that walks the sample elements and writes one row per element. Writing your own script gives you explicit control over how sub-samples and missing attributes are handled.
Illustrative plugin command (paths and plugin type are placeholders; confirm options against the plugin's own documentation):
JMeterPluginsCMD.sh --generate-csv results.csv --input-jtl results.jtl --plugin-type AggregateReport
Online JTL-to-CSV converters also exist. Test results often contain internal URLs, hostnames, query strings and sometimes tokens or response bodies. Uploading the file publishes that content to a third party. A converter's appearance or marketing tells you nothing reliable about how it stores data. Prefer local tools for anything that is not already public, or strip sensitive columns before uploading.
Will the CSV stay readable and usable after sharing?
CSV is plain text, so it copies, diffs, searches and loads into almost any tool. Screen readers navigate it in a spreadsheet as an ordinary table, which is generally easier than reading raw XML attributes. The practical problems are in interpretation, not access.
- Timestamps are epoch milliseconds. Spreadsheets may display them in scientific notation, and readers cannot interpret them until you add a converted date-time column.
- Labels, response messages and failure messages can contain commas or line breaks. A correct converter quotes these fields. A naive split on commas will shift columns, so check a few rows that contain errors.
- The delimiter is configurable through jmeter.save.saveservice.default_delimiter. A file written with tabs or semicolons needs matching import settings.
- Spreadsheet locale settings can treat the comma as a decimal separator or change how numbers are parsed. Explicit import settings avoid this.
- Large load tests can produce more rows than a spreadsheet can open. Excel, for example, stops at 1,048,576 rows per sheet. For very large files, use a database, a script or JMeter's HTML dashboard instead.
- Editing the CSV in a spreadsheet and saving it again can silently reformat timestamps or codes. Keep an untouched copy of the original.
If the audience needs a summary rather than raw rows, a raw CSV is the wrong deliverable. Share an aggregate table or the generated HTML report, and keep the CSV as the underlying data.
Gaps in this review
No hands-on test results, converter benchmarks or version-specific behavior were available for this article. The descriptions of JMeter properties and field mappings reflect JMeter's documented conventions. Confirm them against the documentation for the JMeter version you run, and check any third-party converter on a small sample file before trusting it with a full result set.