RF Glossary

Touchstone File Format: Complete Reference Guide

Complete reference for Touchstone (SNP) file format: version 1 and 2 syntax, options line parameters, MA/DB/RI data formats, frequency units, and port count conventions.

Touchstone File Overview

The Touchstone file format (.snp, where n = port count) is the de facto standard for exchanging S-parameter data between RF instruments, EDA tools, and analysis software. It stores S-parameter magnitude and phase data vs. frequency. RF View reads all standard Touchstone files: .s1p, .s2p, .s3p, .s4p, and beyond.

Version 1 File Structure

# [freq_unit] S [data_format] R [reference_impedance]
! Comment lines start with !
! Option line starts with #
# GHz S DB R 50
! Freq    S11_mag  S11_ang   S21_mag  S21_ang  S12_mag  S12_ang  S22_mag  S22_ang
1.0      -15.2    -25.3    -0.5    -85.2    -30.1    -88.1    -18.3    -22.1
2.0      -18.5    -45.2    -0.6    -165.3   -32.5    -168.2   -21.5    -44.8

Options Line Parameters

FieldOptionsDefault
Frequency unitHz, KHz, MHz, GHzGHz
Parameter typeS, Y, Z, H, GS
Data formatMA (Mag-Angle), DB (dB-Angle), RI (Real-Imag)MA
Reference impedanceR [value]R 50

Data Format Comparison

FormatColumn 1Column 2Best For
MA (Magnitude-Angle)Linear magnitude (0–1)Phase (degrees)General use
DB (dB-Angle)Magnitude in dBPhase (degrees)Human-readable, plot-friendly
RI (Real-Imaginary)Real partImaginary partComputation, numerical precision

N-Port Data Ordering

For a 2-port file, parameter order on each line is: S11, S21, S12, S22 (column pairs in MA/DB/RI format). For a 4-port file (.s4p), each frequency requires multiple data lines:

! 4-port: 16 S-parameters, 2 values each = 32 values
! Touchstone v1 wraps at 4 pairs per line:
! Line 1: S11 S21 S31 S41
! Line 2: S12 S22 S32 S42
! Line 3: S13 S23 S33 S43
! Line 4: S14 S24 S34 S44

Touchstone Version 2 Enhancements

Version 2 (.ts extension or [Version] 2.0 keyword) adds:

  • Explicit port definitions with impedances per-port
  • Mixed-mode S-parameters (differential/common mode)
  • Noise parameters embedded in the file
  • Better support for n-port files with unambiguous data ordering
  • Comment blocks and data integrity checksums

RF View Compatibility

RF View reads Touchstone version 1 files in all three data formats (MA, DB, RI) and all standard frequency units. The app automatically detects the format from the options line and correctly parses data for 1 to 4+ port files. If a file fails to load, check for:

  • Missing or malformed options line (must start with #)
  • Inconsistent number of data columns
  • Non-standard line endings (Windows/Unix mixing)
  • Frequency points not in ascending order

Related Topics

← Back to RF Glossary  ·  RF View Home