fnType-safe validation library
Type-safe form validation without the boilerplate
Formify is a lightweight, dependency-free validation library for JavaScript and TypeScript. Define schemas once, validate everywhere — with full type inference and readable errors.
// Zero dependencies · Full type inference · Framework agnostic
Dependencies
Bundle size
Type inference
schema.ts
inferred type
User
bundle
<3kb
Dependencies
Bundle footprint
Type-safe
Schema, everywhere
// Features
Validation that keeps up with your code
Designed for modern JavaScript and TypeScript projects, Formify makes validation simple, safe, and fast.
schema({ ... })Type-safe schemas
Schemas are fully typed — your validated data is inferred automatically with zero manual annotations.
string().custom(fn)Composable rules
Chain built-in validators or write custom ones. Reuse rules across forms, APIs, and projects.
import { schema }Zero dependencies
Tiny footprint, no runtime deps. Works in browsers, Node.js, and edge runtimes out of the box.
result.errors()Clear error messages
Human-readable errors with field-level context, ready to display directly in your UI.
object({ nested })Nested & arrays
Validate deeply nested objects and arrays of any shape with the same simple schema syntax.
schema.validate(input)Framework agnostic
Use it with React, Vue, Svelte, or plain JavaScript — no framework-specific APIs required.
// Use cases
Perfect for every form
From simple signup forms to complex multi-step workflows, Formify handles it all.
// Why Formify
One schema, everywhere
Validate user input on the client, then reuse the exact same schema on the server. No duplication, no drift between your forms and your API — Formify keeps validation logic in one place.
- ✓Full TypeScript inference — types flow from schema to UI
- ✓Predictable, dependency-free runtime behavior
- ✓Localized, customizable error messages out of the box
- ✓Works on the server and the client with the same API
client.ts
// One schema, everywhere
const schema
= schema( "user" )
// Full TypeScript inference — types flow from schema to UI
// Predictable, dependency-free runtime behavior
schema.validate(input)
✓ types inferred
server.ts
// One schema, everywhere
const schema
= schema( "user" )
// Full TypeScript inference — types flow from schema to UI
// Predictable, dependency-free runtime behavior
schema.validate(input)
✓ types inferred
// FAQ
Questions, answered
Ready to validate better forms?
Get started with Formify in minutes. Read the docs, define your first schema, and start validating — client and server.
$ npm install formify