PeakWright / Guides / Open a .ch file
How to open a .ch file without ChemStation
A .ch file is the raw signal from one detector channel. It is not encrypted, it is
not licence locked, and you do not need Agilent software to read it. Here are the four routes
that work, and how to pick one.
The short answer. If you want to look at the run, use a reader that opens the file directly. If you want the numbers in a script, use a library. The one thing not to do is ask someone to email you a screenshot, which is what usually happens and which throws away every number in the file.
What a .ch file actually is
Inside an Agilent .D folder, each detector channel gets its own file. A
.ch holds one signal against time: absorbance at a single wavelength, an FID
trace, a CAD or ELSD channel. One number per time point, evenly spaced, from the start of the
run to the end.
The file starts with a small number that says which layout it uses, then a header holding the sample name, the operator, the method, the instrument and the scaling factors, then the body holding the signal. That is the whole thing. There is no encryption and no licence check anywhere in it.
The reason opening one felt impossible for years is simply that Agilent never published the layout. People worked it out by reading bytes. The format reference on this site writes down what is now known, including four offsets that no published document covers.
Which version are you holding
The version number is the first thing in the file, and it decides everything about how the body is stored. You can see it by opening the file in any hex viewer, or a reader will tell you.
| Version | Body | Typically from |
|---|---|---|
| 30 | Delta encoded integers, short header | Legacy ChemStation. UV, CAD and ELSD channels. |
| 130 | Delta encoded integers, long UTF-16 header | Later ChemStation and OpenLab. Same detectors. |
| 179 | Plain 64 bit floats | FID style layout. |
| 181 | Plain 64 bit floats | FID style layout, later writer. |
Versions 8 and 81 also exist, from older software. They are supported by chromConverter and are less widely handled elsewhere, so if you hold one, that is where to start.
Delta encoding is why a .ch file is smaller than the number of points would
suggest. Rather than storing every value, it stores the change from the previous one, with an
escape for jumps too large to fit. It is a compression scheme, not a protection scheme.
The four routes that work
1. A browser based viewer, if you want to look
Nothing to install and nothing to sign up for. You open a page, drop the file in, and the chromatogram draws. The viewer on this site does this and reads the file inside your own tab, so the data never leaves your machine, which matters if the run is not yours to send anywhere.
Use this when the question is "what does this run look like" or "did the peak shift", which is most of the time. It also exports the numbers, so it is not a dead end if you decide later that you want them.
2. A Python library, if you are scripting
rainbow reads Agilent
.D and .dx directories, including .ch, .uv
and .ms data, and installs with pip install rainbow-api. If you are
already processing data in Python, this is the right answer and nothing here improves on it.
It is a library, not an application, so it gives you arrays rather than a plot. That is what you want in a pipeline and not what you want at four in the afternoon when you just need to see the trace.
3. An R package, if your analysis is in R
chromConverter reads a wide range of
vendor formats into R, covering .ch versions 30, 130, 8, 81, 179 and 181. Some of
its formats are handled directly and others through external tools you install separately, so
check which applies to yours before committing to it.
4. A desktop application, if you want to integrate
OpenChrom is a full open source chromatography application, and it does far more than read files: peak detection, integration, batch processing and reporting. If your problem is that you need a data system rather than a look at a file, this is the serious free option.
It is a desktop install rather than a page you open, and its Agilent import happens through converter plugins. That is a bigger commitment than the other three routes, and it buys much more.
The route to avoid
Do not settle for a screenshot. The usual workaround is to ask someone who still has ChemStation to send a picture of the chromatogram. That answers one question and destroys the file: no retention times you can read, no baseline, no ability to overlay it against another run, nothing to reprocess later.
If you are going to ask them for something, ask for the whole .D folder, or for
an export to CDF, which every tool reads. Both take them about as long as a screenshot.
Which one should you use
| If you want to | Use |
|---|---|
| Look at a run | A browser viewer. Nothing to install, and the file stays local. |
| Script over many files | rainbow, in Python. |
| Analyse in R | chromConverter. |
| Integrate and report | OpenChrom. |
| Send a run to someone | A self contained export they can open with no software at all. |
There is more detail on each of these, including what they cost and what they install, on the tools compared page.
Common questions
Is a .ch file encrypted?
No. It is a plain binary file with a header and a body. Nothing in it is encrypted or licence locked, which is why several independent readers exist. The barrier was always that the layout was undocumented, not that it was protected.
The file opens but the numbers look wrong
Almost always a scaling problem. The signal in the body is stored as raw counts and has to be multiplied by a factor held in the header, and different file versions keep that factor in different places. If a reader gets that offset wrong, the trace shape is right and the axis is nonsense. There is more on this in when a file will not open.
I have a .D folder, not a .ch file
That is normal. The .D is a folder and the .ch files are inside it.
See what is inside a .D folder for which file to
reach for.
My data is a .uv, not a .ch
Different file, harder problem. A .uv holds a whole spectrum at every time point
rather than one value, and support for it is thinner across the board. See
reading .uv DAD data.
Open the file now
Drop a .ch in and read it. Nothing to install, no account, and the file is
decoded in your own browser rather than uploaded anywhere.
PeakWright is not affiliated with or endorsed by Agilent Technologies. "ChemStation" and "OpenLab" are their trademarks.