Wirth was born in Winterthur, Switzerland, in 1934. In 1959 he earned a degree in Electronics Engineering from the Swiss Federal Institute of Technology Zürich (ETH Zürich). In 1960 he earned an M.Sc. from Université Laval, Canada. Then in 1963 he was awarded a Ph.D. in Electrical Engineering and Computer Science (EECS) from the University of California, Berkeley, supervised by the computer designer pioneer Harry Huskey.
From 1963 to 1967 he served as assistant professor of Computer Science at Stanford University and again at the University of Zurich. Then in 1968 he became Professor of Informatics at ETH Zürich, taking two one-year sabbaticals at Xerox PARC in California (1976–1977 and 1984–1985). Wirth retired in 1999.
In 2004, he was made a Fellow of the Computer History Museum "for seminal work in programming languages and algorithms, including Euler, Algol-W, Pascal, Modula, and Oberon."
Wirth was the chief designer of the programming languages Euler, Algol W, Pascal, Modula, Modula-2, Oberon, Oberon-2, and Oberon-07. He was also a major part of the design and implementation team for the Lilith and Oberon operating systems, and for the Lola digital hardware design and simulation system. He received the ACM Turing Award for the development of these languages in 1984 and in 1994 he was inducted as a Fellow of the ACM. He designed the simple programming language PL/0 to illustrate compiler design. It has formed the basis for many university compiler design classes.
His book, written jointly with Kathleen Jensen, The Pascal User Manual and Report, served as the basis of many language implementation efforts in the 1970s and 1980s in the United States and across Europe.
His article Program Development by Stepwise Refinement, about the teaching of programming, is considered to be a classic text in software engineering. In 1975 he wrote the book Algorithms + Data Structures = Programs, which gained wide recognition. Major revisions of this book with the new title Algorithms + Data Structures were published in 1985 and 2004. The examples in the first edition were written in Pascal. These were replaced in the later editions with examples written in Modula-2 and Oberon respectively.
His textbook, Systematic Programming: An Introduction, was considered a good source for students who wanted to do more than "just coding". Regarded as a challenging text to work through, it was sought as imperative reading for those interested in numerical mathematics.
In 1992 he published (together with Jürg Gutknecht) the full documentation of the Oberon OS.. A second book (together Martin Reiser) was intended as a programmers guide.
In 1995, he popularized the adage now known as Wirth's law: "Software is getting slower more rapidly than hardware becomes faster." In his 1995 paper A Plea for Lean Software he attributes it to Martin Reiser.
Wirth has reportedly told the joke that, because Europeans pronounce his name properly, while Americans pronounce it as "nickel's worth", he is called by name in Europe and called by value in America.