Special Sponsor:PromptBuilder— Fast, consistent prompt creation powered by 1,000+ expert templates.
Make your Product visible here.Contact Us

TypeScript vs Flow

Microsoft's TypeScript dominates, but Facebook's Flow pioneered gradual typing for JavaScript. Here's an honest comparison to help you choose — or migrate.

At a Glance

FeatureTypeScriptFlow
CreatorMicrosoftMeta (Facebook)
First released20122014
ApproachLanguage superset (compiles to JS)Type checker only (strips annotations)
Market share~97%+ of typed JS projects~3% and declining
VS Code supportBuilt-in, first-classRequires extension, historically slower
Type definitionsDefinitelyTyped (@types/*)flow-typed (much smaller)
Null safetystrictNullChecks flagMaybe types (?T)
GenericsFull supportFull support
React supporttsx, first-classSupported but community smaller
Migration toolingMature ecosystemflow-to-ts for TS migration
Build step neededYes (tsc / esbuild / swc)No (uses Babel plugin to strip)
Best forAny new or growing projectExisting Meta-stack projects

What is Flow?

Flow is a static type checker for JavaScript developed by Facebook (now Meta) and open-sourced in 2014. Rather than being a new language, Flow reads standard JavaScript files annotated with type comments. A Babel plugin strips the annotations before the code runs, so Flow never changes what your JavaScript does — it only checks it.

Flow popularised gradual typing — the idea that you can add // @flow to individual files and only those files are checked. This let large existing codebases adopt types without a full rewrite.

Flow is still used heavily inside Meta and by a small but dedicated community, but its broader adoption has stalled as TypeScript grew.

What is TypeScript?

TypeScript is a typed superset of JavaScript developed by Microsoft and released in 2012. Every valid JavaScript file is also a valid TypeScript file. TypeScript adds static types, interfaces, enums, generics, and decorators, then compiles down to plain JavaScript.

Because TypeScript is a proper compiler (not just a checker), it can produce optimised output, enforce strict null checks, and provide the data VS Code needs to offer best-in-class autocomplete and refactoring — all without any extra plugins.

Today TypeScript is used by Angular, Next.js, NestJS, Deno, Bun, and most major frontend frameworks. It has over 45 million weekly npm downloads.

Syntax Comparison

Basic annotations

TypeScript

// TypeScript
function add(a: number, b: number): number {
  return a + b;
}

const name: string = "Alice";
const age: number = 30;
const active: boolean = true;

Flow

// @flow
function add(a: number, b: number): number {
  return a + b;
}

const name: string = "Alice";
const age: number = 30;
const active: boolean = true;

Nullable / optional types

TypeScript

// Nullable via union
function greet(name: string | null): string {
  return name ? `Hi ${name}` : "Hi stranger";
}

interface User {
  name: string;
  email?: string; // optional
}

Flow

// Nullable via Maybe type ?T
function greet(name: ?string): string {
  return name ? `Hi ${name}` : "Hi stranger";
}

type User = {
  name: string,
  email?: string, // optional
};

Generics

TypeScript

function identity<T>(value: T): T {
  return value;
}

type ApiResponse<T> = {
  data: T;
  status: number;
  message: string;
};

Flow

function identity<T>(value: T): T {
  return value;
}

type ApiResponse<T> = {
  data: T,
  status: number,
  message: string,
};

Ecosystem & Community

TypeScript ecosystem

  • DefinitelyTyped — 9,000+ type packages via @types/*
  • ✓ Built into VS Code — zero-config autocompletion
  • ✓ First-class support in Next.js, Angular, NestJS, Deno, Bun
  • ✓ 45M+ weekly npm downloads
  • ✓ Stack Overflow's most loved language multiple years running
  • ✓ Active Microsoft backing and open governance

Flow ecosystem

  • flow-typed — community type definitions (much smaller set)
  • ✓ Used heavily inside Meta's internal repos
  • ✓ React Native historically used Flow (migrating)
  • ⚠ Many OSS libraries dropped Flow support
  • ⚠ VS Code extension less reliable than TypeScript LSP
  • ⚠ Smaller community = fewer resources and tutorials

Frequently Asked Questions

What is the difference between TypeScript and Flow?

TypeScript is a language superset of JavaScript that compiles to plain JS and is developed by Microsoft. Flow is a static type checker developed by Meta that strips annotations with Babel rather than compiling. TypeScript has grown to over 97% market share among typed JS projects; Flow is still used inside Meta but sees little new adoption.

Is Flow still maintained in 2024?

Flow is still maintained by Meta and used internally, but community adoption has declined sharply. Many projects that originally used Flow — including React Native's public documentation — have migrated to TypeScript. npm download counts for Flow are a tiny fraction of TypeScript's.

Can I migrate a Flow project to TypeScript?

Yes. The flow-to-ts npm package automates much of the syntax conversion. The annotations are very similar; the main differences are nullable syntax (?T becomes T | null | undefined) and some utility type names. After the codemod you add a tsconfig.json and install @types packages for untyped dependencies.

Does TypeScript have better IDE support than Flow?

Yes, significantly. TypeScript has a built-in language server in VS Code with zero configuration. Flow requires a separate extension that has historically been slower and prone to crashes. Every major editor has mature TypeScript support out of the box.

Which is faster to type-check: TypeScript or Flow?

Both have comparable performance on small-to-medium projects. Flow's incremental checker was historically an advantage on very large monorepos, but TypeScript's project references and incremental compilation (--incremental flag, tsBuildInfoFile) close this gap significantly for most real-world projects.

Should I start a new project with TypeScript or Flow?

Start with TypeScript. It has a vastly larger ecosystem, better tooling, first-class support in every major framework, and a large community. Flow is only a reasonable choice if you are joining an existing codebase already committed to it.

Verdict: Use TypeScript

For any new project in 2024, TypeScript is the clear choice. The ecosystem advantage is overwhelming — DefinitelyTyped covers virtually every npm package, every major framework ships TypeScript configs, and VS Code's built-in TypeScript support is world-class.

Flow is a solid type checker still worth understanding if you maintain a Meta-stack codebase, but for greenfield work the community has decisively moved to TypeScript.

Already have JavaScript code you want to convert to TypeScript?

Try the JS → TS Converter

From the blog

View all →