COMTRADE to CSV converter
Convert a COMTRADE record (.cfg + .dat, .cff or .zip) to a CSV file that opens in Excel, Python or MATLAB, in primary or secondary values. Free, in your browser: nothing is uploaded.
What is in the CSV
| Column | Contents |
|---|---|
time_s | Seconds from the first sample, built from the sampling rates in the .cfg (or from the .dat time stamps when the .cfg declares no fixed rate). |
timestamp (optional) | Time of day of each sample, from the start time in the .cfg, to the microsecond. In the recorder’s own time zone; COMTRADE before 2013 does not say which one that is. |
| One per analog channel | The value after scaling, a × raw + b, then converted to primary or secondary with the ratio in the .cfg. The header names the channel, its unit and which side it is, for example VA (kV, primary). |
| One per status channel | 0 or 1, as recorded: a breaker contact, a trip or a pickup. |
The file is UTF-8 with a byte-order mark, so Excel shows station and channel names correctly, and uses a comma separator with a full stop for decimals. In Python, pandas.read_csv("record.csv") reads it as it is.
One Excel sheet holds 1,048,576 rows. A record sampled at 10 kHz for two minutes has more samples than that; Excel will stop at the limit, so use Python or MATLAB for long records, or keep the CSV for the part that matters.
Before you trust the numbers
Every record is also run through the same file check the viewer uses. If the .dat holds fewer samples than the .cfg declares, a date could be read two ways, or a channel looks unconnected, it is listed above the download, so a CSV is never built from a file that quietly went wrong. The COMTRADE file checker shows the same findings on their own, and the .cfg file, line by line explains every field it reads.
Questions people ask
- How do I convert a COMTRADE file to CSV?
- Drop the .cfg and its .dat (or a single .cff, or a .zip) on this page, choose primary or secondary values, and download the CSV. The first column is time in seconds from the first sample; then one column per analog channel with its unit, and one 0/1 column per status channel.
- Can I open a COMTRADE file in Excel?
- Not directly: a .dat holds raw integers that only mean something after the scaling in the .cfg is applied, and a binary .dat cannot be read as text at all. Convert it to CSV here first; the CSV opens in Excel with the scaling already applied.
- Should I export primary or secondary values?
- Primary values are on the power-system side of the instrument transformers (kV and A on the line); secondary values are what the relay measured (for example 63.5 V and 1 A or 5 A). The .cfg says which one the file holds and gives the ratio, and the converter uses exactly that.
- Is my file uploaded?
- No. The record is read and converted by JavaScript in your browser, and the CSV is built there. Nothing is sent to a server.
- Which COMTRADE versions are supported?
- IEEE C37.111-1991, 1999 and 2013 (IEC 60255-24), with ASCII, BINARY, BINARY32 and FLOAT32 data, as .cfg + .dat, single-file .cff, or a .zip of records.
Want the waveforms instead?
Open the same record in the SagSwell viewer to see the waveforms, one-cycle RMS, sags and swells, harmonics, phasors and the ITIC curve. No file to hand? Use the sample COMTRADE files.