Thanks to visit codestin.com
Credit goes to json-schema-faker.js.org

Trusted by developers worldwide

Fake Your
JSON Schemas

Generate valid JSON data from JSON Schema definitions. Zero production dependencies.

--
GitHub Stars
--
Monthly Downloads
0
Runtime Deps

Simple, Powerful API

Define your schema, generate valid JSON. It's that simple. Supports all JSON Schema 2019-09 and 2020-12 features including $ref, arrays, and complex nested objects.

  • Full JSON Schema 2019-09 & 2020-12 support
  • Extensible with custom generators
  • Works in Node.js and browsers
import { generate } from 'json-schema-faker';

// Define your schema
const schema = {
  type: 'object',
  properties: {
    name: { type: 'string', minLength: 2 },
    email: { type: 'string', format: 'email' },
    age: { type: 'integer', minimum: 18, maximum: 80 }
  },
  required: ['name', 'email']
};

// Generate fake data
const sample = await generate(schema);

Everything You Need

Powerful features for comprehensive test data generation

JSON Schema Support

Full support for JSON Schema 2019-09 and 2020-12 specifications

Extension Support

Optional faker.js or chance.js integration via extensions option

Custom Generators

Extend with your own custom data generators and formats

$ref Support

Full $ref support with cycle detection and remote reference resolution

Zero Dependencies

Lightweight with zero production dependencies. Built for Bun and Node.js

Regex Patterns

AST-based regex parser generates matching strings from pattern keywords

Ready to Get Started?

Install JSON Schema Faker and start generating realistic test data in seconds

# npm
npm install json-schema-faker

# bun
bun add json-schema-faker