Open the app

TRTT › Guides › SPSS Online Compiler: Run SPSS Syntax in Your Browser

SPSS Online Compiler: Run SPSS Syntax in Your Browser

IBM doesn't offer an online compiler for SPSS syntax: SPSS Statistics is a desktop program, and general "online compiler" sites don't know the SPSS language. TRTT is a free browser app with a syntax window that runs a large subset of SPSS commands (FREQUENCIES, CROSSTABS, T-TEST, REGRESSION, COMPUTE, RECODE and many more) on a real .sav file and shows SPSS-style output tables, with the calculations done on your own computer.

It is not the whole SPSS language. The two lists below show exactly what runs and what doesn't, checked against TRTT's parser and engine on 5 October 2026.

Short answer

Try it: a five-line example on the sample dataset

TRTT ships with a sample survey file, demo_omnibus.sav (400 cases, 30 variables), so you can run this without your own data.

  1. Go to trtt.app on a desktop browser.
  2. On the welcome screen, click Sample Dataset.
  3. Open Window ▸ Syntax.
  4. Paste the five lines below and click ▶ Run.
WEIGHT BY weight.
COMPUTE promoter = (nps >= 9).
VALUE LABELS promoter 0 'Other' 1 'Promoter (9-10)'.
CROSSTABS /TABLES=gender BY promoter /CELLS=COUNT ROW /STATISTICS=CHISQ.
T-TEST GROUPS=gender(1 2) /VARIABLES=nps.

What happens: the data are weighted by the survey weight, a new 0/1 variable flags respondents who scored 9 or 10 on the likelihood-to-recommend question, the crosstab compares men and women with row percentages and a chi-square test, and the t test compares their mean scores. The Output window shows the Case Processing Summary, the crosstabulation, Chi-Square Tests, Group Statistics and the Independent Samples Test.

A second example: DO IF, AGGREGATE and TO

This script groups respondents by their 0–10 recommendation score, compares the groups by gender, adds each region's average score to every respondent, and describes the eight attitude items with a TO range:

DO IF (nps >= 9).
COMPUTE nps_group = 3.
ELSE IF (nps >= 7).
COMPUTE nps_group = 2.
ELSE.
COMPUTE nps_group = 1.
END IF.
VALUE LABELS nps_group 1 'Detractor (0-6)' 2 'Passive (7-8)' 3 'Promoter (9-10)'.
CROSSTABS /TABLES=gender BY nps_group /CELLS=COUNT ROW /STATISTICS=CHISQ.
AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=region /region_nps=MEAN(nps).
DESCRIPTIVES VARIABLES=q1 TO q8.

On the sample (unweighted), the DO IF block puts 162 respondents in the detractor group, 134 in the passive group and 104 among promoters. The crosstab shows 25.9% promoters among men and 26.1% among women, and the chi-square test finds no difference (χ² = 1.91, df = 2, p = .386). AGGREGATE adds a new variable, region_nps, holding each region's mean score (from 6.57 in North-West to 7.10 in North), which you can use in later COMPUTE statements. The TO range expands to q1, q2 … q8 in dictionary order.

AGGREGATE follows IBM's rules: with no /OUTFILE it adds the new variables to the open data, /OUTFILE=* without MODE replaces the open data with one row per break group, and reusing an existing variable name needs OVERWRITE=YES. Writing the aggregated data to a separate file (/OUTFILE='file.sav') isn't supported yet.

How the Syntax window behaves

Two things worth knowing:

Supported commands

Commands are case-insensitive and can be abbreviated to their first three letters, as in SPSS.

Group Commands
Descriptive statistics FREQUENCIES, DESCRIPTIVES, EXAMINE, CROSSTABS, MEANS, RATIO STATISTICS, MULT RESPONSE
Comparing groups T-TEST, ONEWAY, UNIANOVA, NPAR TESTS
Correlation and regression CORRELATIONS, REGRESSION (linear), PLUM (ordinal)
Scales and dimension reduction RELIABILITY, FACTOR
Classification CLUSTER, QUICK CLUSTER, TWOSTEP CLUSTER, DISCRIMINANT, KNN
Charts GRAPH, GGRAPH with GPL as pasted by the Chart Builder
Transformations COMPUTE, IF, RECODE, COUNT, RANK, AUTORECODE, RMV, SHIFT VALUES, EXECUTE
Conditional blocks DO IF / ELSE IF / ELSE / END IF
Aggregation AGGREGATE adding variables to the open data (no /OUTFILE, or OUTFILE=* MODE=ADDVARIABLES) or replacing it (OUTFILE=*); OVERWRITE=YES
Cases SELECT IF, FILTER, SPLIT FILE, WEIGHT, SORT CASES
Dictionary VARIABLE LABELS, VARIABLE LEVEL, VARIABLE WIDTH, VALUE LABELS, ADD VALUE LABELS, MISSING VALUES, FORMATS, RENAME VARIABLES, NUMERIC, STRING, ALTER TYPE
Functions (new) ANY, RANGE and LAG, alongside the arithmetic, statistical (MEAN, SUM …) and missing-value functions
Variable lists Ranges with TO (q1 TO q8) in variable lists and function arguments (MEAN(q1 TO q8)), including variables created earlier in the same script
Data in the script DATA LIST (FREE, LIST and fixed columns) with BEGIN DATA … END DATA, which replaces the open data, as in SPSS; NEW FILE; DISPLAY (NAMES, LABELS, VARIABLES, DICTIONARY)
Other Comments (*, ** and COMMENT); SET UNICODE and SET LOCALE (accepted, no effect)

Support for a command doesn't mean support for every subcommand. FREQUENCIES, for example, accepts /VARIABLES, /FORMAT and /STATISTICS, but /HISTOGRAM and /PERCENTILES return a "subcommand not yet supported" message. The message always names the part it doesn't understand, so you know what to change.

Not supported (yet)

These return "unknown command" or a specific error in TRTT today:

Area Not supported
Loops LOOP, DO REPEAT, VECTOR
Restructuring and files MATCH FILES, ADD FILES, AGGREGATE to a separate file, DATASET commands, TEMPORARY
Procedures LOGISTIC REGRESSION, CTABLES, MIXED, GLM (multivariate and repeated measures; use UNIANOVA for univariate models)
Macros and programmability DEFINE … !ENDDEFINE, BEGIN PROGRAM
Listing LIST
Opening and saving data GET FILE, SAVE OUTFILE, DATA LIST FILE=. Use File ▸ Open Data… and File ▸ Save / Save As… instead

Two more commands are understood but can't run from the Syntax window in the browser: GET DATA (CSV/Excel import) and SAVE TRANSLATE (CSV/Excel export). A web page can't read or write files at the paths written in syntax, so TRTT points you to File ▸ Import Data… and File ▸ Export…, which produce the same result through the browser's file dialogs.

If your script depends on the commands in this table, run it in SPSS, or try PSPP, the free GNU desktop program that reads SPSS syntax and data files (check its manual for the specific command).

Opening and saving .sps files

Getting syntax from dialogs (Paste)

Every analysis dialog has the same five buttons as SPSS: OK, Paste, Reset, Cancel, Help. Paste writes the command for your current dialog settings into the Syntax window instead of running it. It's the fastest way to learn the syntax for a procedure, and to build a script you can rerun when the data change.

The menus follow the SPSS 32 layout (Analyze ▸ Compare Means and Proportions ▸ Independent-Samples T Test, for example), so instructions written for SPSS usually work click for click.

Translating to R or Python

Below the editor, the Paste panel has three tabs: SPSS, R and Python. After you click Paste in a dialog, the R and Python tabs show code that performs the same analysis, and the Copy button puts it on your clipboard.

The translation aims for the same statistics, not the same printout: an R or Python script may lay out a table differently from SPSS. Treat it as a starting point for learning or for moving a project to code, and compare the key numbers with the TRTT output.

Open TRTT in your browser – free

Related: SPSS alternative online · TRTT vs PSPP · R vs SPSS · SPSS trial expired?

FAQ

Is there an official online version of SPSS syntax?

IBM SPSS Statistics is a desktop application for Windows and macOS; there is no IBM web page where you paste syntax and get output. Browser tools like TRTT run an SPSS-compatible subset instead.

Is my data uploaded when I run syntax in TRTT?

No. The .sav file and the calculations stay in your browser on your own computer. The web app sends anonymous feature-usage counters (not your data), and those are turned off if your browser sends Global Privacy Control or Do Not Track.

Does TRTT run DO IF and AGGREGATE?

Yes. DO IF / ELSE IF / ELSE / END IF blocks, single-line IF, and AGGREGATE into the open data (adding variables or replacing the cases) run in the web version. LOOP, DO REPEAT and file merging don't yet. A command TRTT doesn't know is logged as "unknown command" and the rest of the script still runs, but anything later steps expect from it will be missing.

Can I use TO in variable lists?

Yes. FREQUENCIES VARIABLES=q1 TO q8. and COMPUTE att = MEAN(q1 TO q8). both work, and a range can include variables created earlier in the same script.

Does the syntax window work on iPad or iPhone?

The TRTT iOS app has its own syntax editor with the same engine. IF, DO IF, AGGREGATE, TO ranges and the ANY, RANGE and LAG functions are in the web version and are coming to the iOS app in the next update. The web version is built for desktop browsers. See SPSS for iPad.


TRTT is an independent product. It is not affiliated with or endorsed by IBM. IBM and SPSS are trademarks of International Business Machines Corporation.

More in Guides