Touchstone S-parameter matrix report
Read one declared 1–4-port Touchstone S-parameter file into a complete matrix CSV/JSON, preserving raw numeric tokens, option provenance and source positions.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Export every Sij measurement in the correct port order before plotting. Inspect complex values, magnitude, phase and dB alongside the original RI, MA or DB tokens; no device or circuit is simulated.
How to use this tool
- Select the ASCII .sNp source and explicit port count; confirm the option line and physical matrix rows.
- Inspect frequency, reference, representation and matrix coordinate summaries.
- Download all complex pairs as JSON/CSV, retaining raw measurements before plotting or further analysis.
Supported inputs and limits
One ASCII file or paste up to 10 MiB with explicit 1–4 ports. A recognized .sNp filename must match the selected port count. Up to 20,000 strictly increasing frequency points, 100,000 complex pairs and 4,096 UTF-16 units per numeric token; complete JSON/CSV together up to 40 MiB. Combined limits apply.
Visible Version1.0/1.1 compatible S-parameter profile: exactly one pre-data # option line. An empty # means GHz, S, MA, R50. A positive finite scalar R may occur in any supported option order. Missing # is invalid; second/late options, per-port R, Y/Z/G/H, noise records and 2.x keywords are Unsupported profile.
Physical rows: 1/2-port points keep frequency and every complex pair on one line; 3/4-port points use one matrix row per physical line, frequency only in the first row. Other valid wrapping is Unsupported rather than labelled a standard error. LF/CRLF, inline ! comments and original ASCII source are preserved; standalone CR and non-ASCII input are unsupported.
Two-port source order is S11,S21,S12,S22; 3/4-port order is matrix-row order. Full raw token strings and line/column/byte coordinates accompany derived float64 real, imaginary, magnitude, normalized phase degrees and 20log10 magnitude dB. Exact zero has phase0 and explicit string -Infinity dB. Nonfinite input, float64 overflow/underflow and unsupported ranges reject rather than fabricate values.
Complete JSON preserves option defaults, reference, source hash, comments and every matrix pair. CSV retains all frequency/pair rows and safe spreadsheet text. Table previews 200 pairs, clipping cells to 2,000 UTF-16 units; above 20,000 report characters, copy is a labelled preview. No RF calibration, circuit performance, reciprocity or device validation.
Worked example
Example input
! Two-port RI measurements; input order S11,S21,S12,S22 # S R 75 MHz RI 1 0.1 0 0.8 -0.2 0.02 0.01 0.15 0 ! sample one 2 0.2 0 0.7 -0.1 0.03 0.01 0 0
Example options
{"secondary":"","params":{"ports":"2","spreadsheetSafe":true}}Example output
{"format":"Touchstone-1.0-1.1-bounded-S-profile","summary":{"ports":2,"frequencies":2,"complexPairs":8,"comments":2,"representation":"RI","frequencyUnit":"MHz","referenceOhms":75,"status":"declared-S-parameter-profile","inputBytes":154},"options":{"unit":"MHz","parameter":"S","representation":"RI","referenceOhms":75,"rawReference":"75","defaulted":[],"line":2,"byteOffset":57,"rawLine":"# S R 75 MHz RI"},"source":{"name":"pasted.txt","bytes":154,"sha256":"c2d6fbb95e650e367fd2ceaf34b63e6af84471edee03226a1eb081334e2380e1","text":"! Two-port RI measurements; input order S11,S21,S12,S22\r\n# S R 75 MHz RI\r\n1 0.1 0 0.8 -0.2 0.02 0.01 0.15 0 ! sample one\r\n2 0.2 0 0.7 -0.1 0.03 0.01 0 0\r\n"},"comments":[{"line":1,"column":1,"byteOffset":0,"text":"! Two-port RI measurements; input order S11,S21,S12,S22"},{"line":3,"column":35,"byteOffset":108,"text":"! sample one"}],"frequencies":[{"index":1,"raw":"1","frequencyHz":1000000,"line":3,"column":1,"byteOffset":74,"pairs":[{"row":1,"column":1,"raw":["0.1","0"],"source":{"line":3,"columns":[3,7],"byteOffsets":[76,80]},"real":0.1,"imag":0,"magnitude":0.1,"phaseDeg":0,"dB":-20},{"row":2,"column":1,"raw":["0.8","-0.2"],"source":{"line":3,"columns":[9,13],"byteOffsets":[82,86]},"real":0.8,"imag":-0.2,"magnitude":0.8246211251235321,"phaseDeg":-14.036243467926479,"dB":-1.6749108729376365},{"row":1,"column":2,"raw":["0.02","0.01"],"source":{"line":3,"columns":[18,23],"byteOffsets":[91,96]},"real":0.02,"imag":0.01,"magnitude":0.022360679774997897,"phaseDeg":26.56505117707799,"dB":-33.01029995663981},{"row":2,"column":2,"raw":["0.15","0"],"source":{"line":3,"columns":[28,33],"byteOffsets":[101,106]},"real":0.15,"imag":0,"magnitude":0.15,"phaseDeg":0,"dB":-16.478174818886377}]},{"index":2,"raw":"2","frequencyHz":2000000,"line":4,"column":1,"byteOffset":122,"pairs":[{"row":1,"column":1,"raw":["0.2","0"],"source":{"line":4,"columns":[3,7],"byteOffsets":[124,128]},"real":0.2,"imag":0,"magnitude":0.2,"phaseDeg":0,"dB":-13.979400086720375},{"row":2,"column":1,"raw":["0.7","-0.1"],"source":{"line":4,"columns":[9,13],"byteOffsets":[130,134]},"real":0.7,"imag":-0.1,"magnitude":0.7071067811865476,"phaseDeg":-8.13010235415598,"dB":-3.0102999566398116},{"row":1,"column":2,"raw":["0.03","0.01"],"source":{"line":4,"columns":[18,23],"byteOffsets":[139,144]},"real":0.03,"imag":0.01,"magnitude":0.03162277660168379,"phaseDeg":18.434948822922014,"dB":-30},{"row":2,"column":2,"raw":["0","0"],"source":{"line":4,"columns":[28,30],"byteOffsets":[149,151]},"real":0,"imag":0,"magnitude":0,"phaseDeg":0,"dB":"-Infinity"}]}],"scope":"Explicit ports1–4; one scalar-reference option line; LF/CRLF physical rows. Derived values are float64 approximations; raw numeric lexemes and ASCII byte/line coordinates are retained. No circuit/device/calibration/reciprocity validation. Unsupported: second/late options, per-port reference, other parameters, noise,2.x keywords or wrapping outside this physical row profile.","precision":"RI is direct; MA/DB uses reduced degree angles and float64 trigonometry. phaseDeg is normalized by atan2. Exact zero has phase0 and dB string -Infinity. Lexical nonzero float64 underflow or nonfinite derived ranges return Unsupported."}When something does not work
Confirm explicit ports and .sNp filename, one # option, ASCII and supported physical rows. Fix malformed/non-increasing frequencies; re-export unsupported variants deliberately. Reduce input when combined counts or complete outputs exceed budgets, then rerun; no partial matrix is returned.
Frequently asked questions
Why does a two-port file list S21 before S12?
The legacy two-port order is S11,S21,S12,S22. The report assigns each pair its row and column instead of treating the four values as row-major.
Are magnitude and phase exact replacements for my measurements?
No. Conversion uses float64. Raw RI/MA/DB tokens and source coordinates remain available; phase is normalized with atan2 and exact zero is explicitly labelled.
Why does another reader accept a file that this tool rejects?
Touchstone supports more variants than this bounded first release. Repeated options, per-port references, noise, 2.x keywords and different valid wrapping return Unsupported; re-export the stated profile rather than deleting information blindly.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.