Skip to content
Fastify v5.x · Node.js 20+

Fast and low overhead.
For Node.js.

Fastify is a web framework focused on the best developer experience with the least overhead. A powerful plugin architecture, schema-based speed, and one of the fastest cores in Node.js.

Get started
$npm install fastify
downloads / mo
0
github stars
0
plugins
297
throughput
Express34,096 req/sHapi40,981.6 req/sKoa48,133.6 req/sHono52,585.6 req/sH357,977.6 req/s0k30k60k0REQUESTS / SECOND
1.7x
vs express
TS
types included
HospitalRunNearformPlatformaticval townHandsontableSerpApikogiQALokalisePhotonN-iXHospitalRunNearformPlatformaticval townHandsontableSerpApikogiQALokalisePhotonN-iX

// why fastify

Efficiency is a feature

An efficient server keeps your infrastructure costs low, stays responsive under load, and leaves your users happy. Fastify is built to serve as many requests as possible without compromising on security, validation, or developer experience. Inspired by Hapi and Express, it's one of the fastest web frameworks around.

// core features

Built on solid principles

~60k req/s

Highly performant

One of the fastest web frameworks in town. Depending on code complexity, Fastify can serve around 60 thousand requests per second.

hooks · plugins

Extensible

Fully extensible via its hooks, plugins, and decorators. Encapsulation keeps your components isolated and reusable.

JSON Schema

Schema based

Use JSON Schema to validate routes and serialize outputs. Internally Fastify compiles the schema into a highly performant function.

Pino built-in

Logging

Logs are important but costly. We chose the fastest logger, Pino, to almost entirely remove that cost.

DX first

Developer friendly

Expressive by design, built to help developers in daily use without sacrificing performance or security.

types included

TypeScript ready

We work hard to maintain a TypeScript type declaration file to support the growing TypeScript community.

// quick start

Type-safe from the start

Install Fastify and TypeBox, then create server.ts. The same schema validates incoming data, serializes the response, and infers the request type for your handler.

$npm install fastify @fastify/type-provider-typebox typebox
Explore the full documentation
import Fastify from 'fastify'
import { Type } from 'typebox'
import type { TypeBoxTypeProvider } from '@fastify/type-provider-typebox'

const fastify = Fastify({ logger: true })
  .withTypeProvider<TypeBoxTypeProvider>()

fastify.get('/', {
  schema: {
    querystring: Type.Object({
      name: Type.Optional(Type.String()),
    }),
    response: {
      200: Type.Object({
        hello: Type.String(),
      }),
    },
  },
}, async (request) => {
  return { hello: request.query.name ?? 'world' }
})

await fastify.listen({ port: 3000 })

// benchmarks

Fast, from the ground up

Leveraging deep experience with Node.js performance, Fastify was built to be as fast as possible. Compare it against other common frameworks.

See full benchmarks
Fastify5.10.0
59,603
H32.0.1-rc.26
57,978
Hono4.12.32
52,586
Koa3.2.1
48,134
Hapi21.4.10
40,982
Express5.2.1
34,096

req/s · higher is better · illustrative comparison

// ecosystem

A plugin for everything

An ever-growing ecosystem of 297 plugins. There's probably already one for your database or template engine — and it's very easy to write your own.

Explore 297 plugins

Enables the use of CORS in a Fastify application.

Plugin for serving static files as fast as possible.

The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.

Ready to go fast?

Ship a production-grade API today. Start with the guide, or dive into the reference.