What Is TypeScript? JavaScript's Typed Superset, Explained
TypeScript adds optional static types to JavaScript and compiles back to it, catching bugs early and powering tools from VS Code to Angular to Next.js.
TypeScript is a programming language built by Microsoft that adds optional static types to JavaScript, then compiles back down to plain JavaScript so it can run anywhere JavaScript already runs. Developers write code with type annotations, interfaces, and other type-checking features; a compiler called tsc catches type-related mistakes before the code ever executes, then strips the types away and outputs ordinary JavaScript for the browser, Node.js, or any other JavaScript runtime.
- What it is: A strongly typed superset of JavaScript — every valid JavaScript program is also valid (or nearly valid) TypeScript.
- Who makes it: Microsoft, led originally by C# architect Anders Hejlsberg; first released in October 2012; open source under the Apache License 2.0.
- How it runs: It compiles ("transpiles") to JavaScript. Browsers and Node.js never run TypeScript directly — they run the JavaScript it produces.
- Current version: TypeScript 7.0, released July 8, 2026, with a compiler rewritten natively in Go for large speed gains.
- Where it's used: Angular, Next.js, much of VS Code's own codebase, and large parts of the Node.js and React ecosystems.
What Is TypeScript, Exactly?
TypeScript describes itself simply: "JavaScript with syntax for types." It's a free, open-source language maintained by Microsoft that layers a static type system on top of JavaScript. Instead of discovering at runtime that you tried to call a method on undefined or passed a string where a number was expected, TypeScript's compiler checks your code against the types you've declared (or that it has inferred) and flags the mismatch immediately, in your editor, before you ever run the program.
Because TypeScript is a superset of JavaScript, the relationship only goes one way: valid JavaScript is generally valid TypeScript, but not every TypeScript file is valid JavaScript, since TypeScript's extra type syntax (like : string after a variable name) isn't something a JavaScript engine understands. That's why TypeScript needs a compilation step — more on that below. You can read the project's own quick overview in its "TypeScript in 5 minutes" handbook page.
What Is TypeScript vs JavaScript? The Actual Differences
JavaScript is dynamically typed: a variable can hold a string one moment and a number the next, and the language won't object until something breaks while the program is running. TypeScript adds a layer on top that lets you declare — or let the compiler infer — what type a variable, function parameter, or return value is supposed to be, and it checks that consistency ahead of time.
TypeScript uses what's called a structural type system: if two objects have the same shape (the same properties and types), TypeScript treats them as compatible, regardless of what they're named. You don't have to explicitly declare that an object "implements" an interface the way you might in Java or C#; it just needs to have the right shape.
| Aspect | JavaScript | TypeScript |
|---|---|---|
| Typing | Dynamic — types checked at runtime | Static (optional) — types checked before running |
| Runs in browsers/Node.js natively | Yes | No — compiles to JavaScript first |
| Extra syntax | None beyond standard ECMAScript | Type annotations, interfaces, generics, enums |
| Error detection | Mostly at runtime | Mostly at compile time / in the editor |
| Tooling (autocomplete, refactoring) | Limited by inference from plain JS | Richer, since types feed the editor directly |
| Learning curve | Lower to start | Slightly higher — you learn the type system too |
| File extensions | .js, .jsx | .ts, .tsx |
Crucially, TypeScript doesn't replace JavaScript — it's a tool that sits in front of it. Any working JavaScript codebase can, in principle, be renamed file-by-file to .ts and adopted gradually, which is part of why it spread so quickly through existing projects rather than only new ones.
Why Developers and Companies Use TypeScript
The core pitch, in TypeScript's own words, is that it "speeds up your development experience by catching errors and providing fixes before you even run your code." A few concrete reasons show up again and again in how teams justify adopting it:
- Catching bugs earlier. A whole category of "cannot read property of undefined" or "expected a string, got a number" bugs gets flagged while you're typing, instead of surfacing in production or during a test run.
- Better editor tooling. Because the editor knows the exact shape of your data, autocomplete, inline documentation, "jump to definition," and safe renaming all become more accurate. This is the same reasoning behind IntelliSense-style tooling in Microsoft's own editors.
- Safer refactoring at scale. On a large codebase with many contributors, renaming a field or changing a function's return type can quietly break code elsewhere. A type checker catches those breaks immediately rather than relying on someone remembering to grep the codebase.
- Self-documenting code. A function signature like
function getUser(id: number): Usertells you more at a glance than a bare, untyped JavaScript function does. - Gradual adoption. You don't need to rewrite anything to start. TypeScript can type-check plain JavaScript files using JSDoc comments and a
// @ts-checkdirective, letting teams dip a toe in before committing.
None of this is free: writing and maintaining types takes some extra effort, and the type system has a learning curve of its own. The tradeoff is explicit — more upfront structure in exchange for fewer surprises later, which is why TypeScript tends to pay off more on larger, longer-lived, multi-developer codebases than on a quick one-off script.
How TypeScript Compiles Down to JavaScript
TypeScript code never runs as-is. Before it reaches a browser or Node.js, it goes through a compilation (strictly, a "transpilation") step that does two things: it checks your types against each other and reports any mismatches, and it strips out every piece of TypeScript-only syntax, leaving behind clean, ordinary JavaScript.
The official compiler is a command-line program called tsc, installed as part of the typescript npm package. Running npx tsc on a project reads its configuration from a tsconfig.json file and emits .js files that any JavaScript engine can run. Tools like Babel, esbuild, and swc can also strip TypeScript syntax (without full type checking) for faster builds, which is why TypeScript's own docs flag a setting called isolatedModules for projects using those tools alongside tsc for type checking.
Because the type annotations are erased entirely during compilation, they add zero runtime overhead — the JavaScript that comes out the other end looks essentially like what a JavaScript developer would have written by hand, just without the inline types.
Basic TypeScript Syntax: A Quick Tour
TypeScript's syntax is JavaScript's syntax, plus a layer of type declarations. A plain JavaScript variable:
let name = "Ada";
can be given an explicit type, though TypeScript would infer string automatically here anyway:
let name: string = "Ada";
Object shapes are usually described with an interface:
interface User {
name: string;
id: number;
}
const user: User = {
name: "Ada",
id: 1,
};
If you tried to assign an object missing the id field, or with an extra, misspelled property, to a variable typed as User, the compiler would reject it right there in the editor — before the code runs. Functions can have their parameters and return values typed the same way:
function getUser(id: number): User {
// ...implementation
}
Other common building blocks include generics (types that work across multiple other types, like an array that can hold strings or numbers but stays consistent), union types (a value that can be one of several named options, such as "pass" | "fail"), and enums (a named set of constant values). None of this syntax exists in standard JavaScript — it's TypeScript's addition, and it all disappears by the time the code is compiled.
TypeScript 7.0: The Compiler's Native Rewrite
The most significant recent change to TypeScript isn't a new piece of syntax — it's a rewrite of the compiler itself. On July 8, 2026, Microsoft shipped TypeScript 7.0, which replaces the original compiler (which was itself written in TypeScript/JavaScript) with a native port written in Go.
The headline reason is speed. According to Microsoft's own release post, full project builds across several real open-source codebases sped up between roughly 8x and 12x compared with TypeScript 6. The post gives specific numbers: the Visual Studio Code codebase went from a 125.7-second full build down to 10.6 seconds, an 11.9x improvement, with similar gains measured on the Sentry, Bluesky, Playwright, and tldraw codebases. Peak memory use also dropped by 6% to 26% across the same test projects, and the time to see the first error appear in the editor on the VS Code codebase fell from about 17.5 seconds to under 1.3 seconds.
For everyday developers, almost nothing about day-to-day usage changes: you still run npm install -D typescript and npx tsc. Microsoft also shipped a companion @typescript/typescript6 package with a tsc6 command so projects and tools (such as typescript-eslint, or framework tooling for Vue, Svelte, Astro, and Angular templates that still depend on the older programmatic compiler API) can keep running the previous compiler side-by-side while the ecosystem catches up. TypeScript 7.0 also shipped without that older programmatic API at all — Microsoft says a new one is coming in a future 7.1 release.
Where TypeScript Is Used
TypeScript has become the default starting point for a large share of professional JavaScript development, rather than a niche option:
- Angular. Google's Angular framework is built around TypeScript at its core — component classes, decorators, and the framework's own documentation all assume you're writing
.tsfiles. - Next.js. The popular React framework ships with built-in TypeScript support: creating a new project with
create-next-appcan configure a workingtsconfig.jsonautomatically, and renaming a file to.tsor.tsxin an existing project triggers the same setup. Pandromeda covered the framework's most recent major release in our Next.js 16.4 report. - Node.js. Recent versions of Node.js can run
.tsfiles directly by stripping type annotations at load time, without a separate build step, for files that use only "erasable" TypeScript syntax — see our explainer on Node.js's release model for more on how the runtime's yearly LTS cycle has evolved. - Visual Studio Code. Microsoft's own editor relies on TypeScript's language service to power its JavaScript and TypeScript editing features, including autocomplete and inline error checking — the same editor we recently covered for its agent sandboxing update.
- React. Components written as
.tsxfiles are common across the React ecosystem, letting props and state be type-checked the same way as any other TypeScript code.
The project's own GitHub repository, microsoft/TypeScript, has accumulated well over 100,000 stars, and TypeScript has repeatedly ranked among the most-used languages in annual developer surveys — evidence the project cites directly on its own homepage.
Getting Started: Installing TypeScript and tsconfig.json
Trying TypeScript doesn't require any special setup beyond Node.js and a package manager. The project's own installation guide recommends installing it per-project rather than globally, so a team's lockfile pins everyone to the same compiler version:
npm install typescript --save-dev
From there, the compiler can be run through npx without a separate global install:
npx tsc
Most real projects also use a tsconfig.json file, which tells the compiler which files to include and how strict to be. Running npx tsc --init generates a starter file with sensible defaults and inline comments explaining each option; the full list of settings is documented in TypeScript's TSConfig reference. A newly initialized TypeScript 7.0 project now defaults to stricter settings out of the box, including strict: true, which turns on the compiler's full set of type-safety checks.
For anyone who wants to try TypeScript without installing anything at all, the TypeScript Playground on the official site runs the compiler entirely in the browser, which is also where the handbook's introductory examples can be edited and run live.
What's Next: Should You Learn TypeScript?
If you already write JavaScript and work on anything beyond a small script — a team project, an app that will be maintained for more than a few weeks, or any codebase with more than one contributor — TypeScript is worth trying specifically because adoption can be incremental. You can rename a single file, add a tsconfig.json, and start getting type checking on just that file while the rest of the project stays plain JavaScript.
A reasonable first step is working through the official handbook's "TypeScript in 5 minutes" guide, installing the compiler with npm install typescript --save-dev, and running it against one real file in an existing project. From there, the TSConfig reference and the release notes for TypeScript 7.0 on Microsoft's TypeScript DevBlog are the most reliable places to track what changes next, since the language and compiler are still being actively developed under Microsoft's stewardship on GitHub.
Frequently asked questions
What is TypeScript used for?
TypeScript is used to write JavaScript applications with static type checking, catching type-related bugs in the editor before the code runs. It shows up across web frontends (React, Angular), backend Node.js services, and developer tooling, then compiles down to plain JavaScript to actually run.
What is TypeScript vs JavaScript?
JavaScript is a dynamically typed language that runs natively in browsers and Node.js. TypeScript is a superset of JavaScript that adds optional static types and extra syntax like interfaces and generics, then compiles down to plain JavaScript, since browsers and Node.js can't run TypeScript directly.
Is TypeScript a separate programming language from JavaScript?
Yes and no. TypeScript is technically its own language with its own compiler, but it is designed as a superset of JavaScript, meaning ordinary JavaScript code is generally also valid TypeScript. The extra type syntax TypeScript adds is removed during compilation, leaving plain JavaScript.
Who created and maintains TypeScript?
TypeScript was created at Microsoft and first released in October 2012. It is open source under the Apache License 2.0 and is developed on GitHub in the microsoft/TypeScript repository.
Do I need to learn TypeScript before learning JavaScript?
No. TypeScript builds directly on JavaScript syntax, so most people learn JavaScript fundamentals first and add TypeScript's type system afterward. TypeScript's own handbook assumes some familiarity with JavaScript.
How do I start using TypeScript in a project?
Install it per-project with npm install typescript --save-dev, then run npx tsc to compile. Running npx tsc --init generates a starter tsconfig.json file that controls how strict the type checking is.
Sources
- TypeScript — JavaScript With Syntax For Typestypescriptlang.org
- TypeScript Handbook: TypeScript in 5 Minutestypescriptlang.org
- TypeScript Installation Guidetypescriptlang.org
- Microsoft DevBlogs: Announcing TypeScript 7.0devblogs.microsoft.com
- microsoft/TypeScript on GitHubgithub.com
- TypeScript - Wikipediaen.wikipedia.org
Felix Moreau writes Pandromeda's software coverage and how-to guides. He covers Windows, macOS and Linux updates, the apps people rely on, emulators and developer tools, and turns official documentation into clear, numbered steps that work on the current version.


