Touchstone Data Format
How a Touchstone File Encodes Network Data
A Touchstone file is deliberately human-readable: it is whitespace-delimited ASCII with optional comment lines starting with an exclamation mark. Three line types make up the structure. Comment lines carry header text such as the instrument name, calibration date, and DUT description. The single option line, beginning with a hash, defines how the numbers should be interpreted. Data lines then list one frequency per record, followed by the network-parameter pairs in either magnitude/angle (MA), decibel/angle (DB), or real/imaginary (RI) form. Because the convention is global rather than per-column, mixing MA and RI within one file is not allowed; a converter must rewrite the entire data block to change format.
The most error-prone detail is two-port column ordering. A .s2p row lists S11, then S21, then S12, then S22, so the forward transmission term S21 appears before the reverse term S12. This single anomaly exists only for two-port files; three-port and larger files revert to strict row-major matrix order (S11 S12 S13, then the second row, and so on), with one matrix row per physical text line. Touchstone 1.1 carries no internal record of the port count, so a parser must infer it from the .sNp extension. The data file formats used across the industry, including CITIfile and the newer Touchstone 2.0, were partly motivated by removing this ambiguity.
Option Line and Data Conversion
The option line takes the form: # [freq unit] [parameter] [format] R [Zref]. Any omitted field falls back to its default, but the fields must appear in the fixed order unit, parameter, format, reference, so a parser keys on position rather than on the value it encounters. Angle data are always in degrees, never radians. When data are stored as decibels and angle, the recorded value is 20·log10 of the linear magnitude, so a reflection coefficient with a return loss of 15 dB is stored as a magnitude entry of -15 dB (S11 in dB is negative for a passive port), while the phase travels in the paired angle column.
# <freq_unit> <param> <format> R <Zref> e.g. # GHz S RI R 50
Decibel-angle format (DB):
magdB = 20 × log10|Sij|, θ in degrees
Real-imaginary ↔ magnitude-angle:
Sij = a + jb → |Sij| = √(a² + b²), θ = atan2(b, a) × 180/π
.s2p row order (fixed):
f S11 S21 S12 S22
Defaults when the option line is absent: GHz, S, MA, R 50. For an n-port (n ≥ 3) file the matrix is written row-major, one row per text line, n² pairs per frequency.
Touchstone 1.1 vs. 2.0 and Related Formats
| Attribute | Touchstone 1.1 | Touchstone 2.0 | CITIfile |
|---|---|---|---|
| File extension | .sNp | .ts (or .sNp) | .cti / .citi |
| Port count source | Inferred from extension | [Number of Ports] keyword | NAME / VAR blocks |
| Reference impedance | Single R value, all ports | Per-port [Reference] list | Constant per package |
| Data conventions | MA, DB, RI | MA, DB, RI | MAG/ANG, RE/IM, dB |
| Noise parameters | 2-port only, appended block | Formal [Noise Data] section | Supported via data blocks |
| Matrix layout marker | None | [Matrix Format] full/lower/upper | Implicit by segment |
| Standardized by | EEsof (de facto) | IBIS Open Forum, 2009 | HP / Agilent |
Frequently Asked Questions
What does the option line in a Touchstone file mean?
The line begins with # and declares four global settings: frequency unit (Hz, kHz, MHz, GHz), parameter type (S, Y, Z, H, G), data format (MA, DB, or RI), and the keyword R with the reference impedance in ohms. For example, # MHz S MA R 50 means S-parameters in linear magnitude and degrees, in MHz, normalized to 50 Ω. If no option line is present, parsers assume # GHz S MA R 50.
How are the columns ordered in a .s2p versus a .s3p file?
A .s2p row is f, S11, S21, S12, S22, so S21 precedes S12, a frequent parsing pitfall. For three ports and up the data are row-major (S11 S12 S13, then row two, and so on) with one matrix row per text line. Touchstone 1.1 has no port-count marker, so the reader must trust the .sNp extension; Touchstone 2.0 adds a [Number of Ports] keyword.
What is the difference between Touchstone 1.1 and Touchstone 2.0?
Version 1.1 is the legacy format: simple # option line, no version tag, port count taken from the extension, single 50 Ω reference. Version 2.0 (IBIS Open Forum, 2009) adds bracketed keywords such as [Version] 2.0, [Number of Ports], [Reference] for per-port impedance, and [Matrix Format], plus formal noise-parameter support. A compliant 2.0 reader still parses 1.1 files.
Can a Touchstone file hold Y- or Z-parameters instead of S-parameters?
Yes. The second field of the option line selects the parameter type: S for scattering, Y for admittance, Z for impedance, H for hybrid, or G for inverse hybrid. The most common choice for high-frequency measured data is S, because scattering parameters are what a VNA measures directly and they remain well-defined at frequencies where open and short terminations are impractical.