March 11, 2026By Digital Ullu

Types vs Interfaces in Typescript

TL;DR;

The main concept interfaces offer over types is declaration merging. On the other side, types can do a lot more than interfaces (mapped types, conditional types, etc)

Both can define object structure and in simple case both work identically

interface User {
	name: string;
	age: number;
}

type User = {
	name: string;
	age: number;
}

The major differences are —

Interfaces have Declaration Merging

interface Employee {
	name: string;
}

interface Employee {
	age: number;
}

// Result will be
interface Employee {
	name: string;
	age: number;
}

This same will not work with type

type Employee = { name: string };
type Employee = { age: number }; // ERROR

Types can represent more than objects

type can define many more kinds of types.

Primitive

type Name = string;

Union

type Status = "success" | "error";

Tuple

type Data = [number, string];

Intersection

type A = { a: number };
type B = { b: string };

type C = A & B;

Interfaces cannot do these.

Extending Types

  • Interface (inheritance) – we can extend interfaces like below:-
interface A {
	a: number;
}

interface B extends A {
	b: string;
}
  • Type (intersection) – type can be intersect like below:-
type A = { a: number };
type B = A & { b: string };

Both work, but syntax differs.

Classes Implementing

Classes can implement both

interface Employee {
	name: string;
}

class Admin implements Employee {
	name = "Sagar"
}
type Employee = {
	name: string;
}

class Admin implements Employee {
	name = "Sagar"
}

But classes cannot implement union types

Mapped types (only for Type)

type keys = "a" | "b";

type Obj = {
	[k in keys]: number;
}

Interfaces cannot do this stunt. 😆

If you want to read more you can check out this stack overflow – https://stackoverflow.com/a/57833631/5412542

DigitalUllu

DigitalUllu is a knowledge-driven blog sharing tech tutorials, deep insights, productivity ideas, and life lessons. Discover thoughtful content on technology, self-improvement, and continuous learning—one honest post at a time.

© 2026 DigitalUllu. All rights reserved.