# TypeScript Interfaces vs Types
Both `interface` and `type` can describe the shape of an object, and for basic cases they're interchangeable. But their differences matter as a codebase grows.
## Basic Syntax
```typescript
interface User {
name: string;
age: number;
}
type UserType = {
name: string;
age: number;
};
```
Both work identically here — this is why the choice often feels arbitrary at first.
## Declaration Merging
Interfaces can be declared multiple times and TypeScript merges them automatically:
```typescript
interface User {
email: string;
}
// Now User has name, age, and email
```
Type aliases cannot do this — declaring the same type name twice throws an error. This makes interfaces useful for extending third-party types.
## Union and Intersection Types
Type aliases can represent unions, which interfaces cannot:
```typescript
type Status = "active" | "inactive" | "pending";
```
For anything beyond a plain object shape — unions, tuples, mapped types — you need `type`.
## Extending
Both support extension, with slightly different syntax:
```typescript
interface Admin extends User { permissions: string[]; }
type AdminType = UserType & { permissions: string[] };
```
## A Practical Rule
Use `interface` for object shapes that represent entities (props, API models) since they read cleanly and support merging. Use `type` when you need unions, primitives, or more complex type logic.
## Conclusion
Neither is strictly "better" — most teams settle on interfaces for object shapes and types for everything else, and consistency matters more than the specific rule chosen.
Back to Blogs
TypeScript Interfaces vs Types
Interface or type alias? A practical comparison of when each one makes sense in a real TypeScript codebase.
08 Aug 2026
6 min read