DevTools Logo

Mock Data Generator

Mock Data Generator

Generate realistic mock data for testing, prototyping, and development

Generation Settings

Data Type Examples

User Data Fields

• ID (number)
• Name (full name)
• Email (valid email)
• Phone (formatted number)
• Address (full address)
• Company (company name)
• Join Date (ISO date)
• Is Active (boolean)

Usage Examples

Development & Testing:

  • • Populate databases with test data
  • • Test API endpoints with realistic data
  • • Create seed data for development environments
  • • Generate sample data for unit tests

Design & Prototyping:

  • • Fill mockups with realistic content
  • • Test UI layouts with various data lengths
  • • Create demo data for presentations
  • • Validate data visualization designs

    Examples

    TypeScript interface for Users (deterministic schema)

    Input
    Data Type: Users · Count: 1 · Format: TypeScript
    Output
    // Generated TypeScript interface and data
    
    interface User {
      id: number;
      name: string;
      email: string;
      phone: string;
      address: string;
      company: string;
      joinDate: string;
      isActive: boolean;
    }
    
    export const users: User[] = [
      {
        "id": 1,
        "name": "Sample Name",
        "email": "sample@example.com",
        ...
      }
    ];

    The interface is built from the types of the first sample row (id is a number, isActive is a boolean, everything else is a string), so it's identical every time you generate Users. The exported array's per-row values are random, so the schema is the stable part.

    SQL with inferred column types

    Input
    Data Type: Users · Count: 2 · Format: SQL
    Output
    -- Generated SQL for users
    
    CREATE TABLE users (
      id INTEGER,
      name VARCHAR(255),
      email VARCHAR(255),
      phone VARCHAR(255),
      address VARCHAR(255),
      company VARCHAR(255),
      joinDate DATE,
      isActive BOOLEAN
    );
    
    INSERT INTO users (id, name, email, phone, address, company, joinDate, isActive) VALUES
      (1, 'Alice', 'alice@example.com', '+1-555-555-5555', '123 Main St', 'Acme', '2024-01-15', TRUE),
      (2, 'Bob', 'alice@example.com', '+1-555-555-5555', '123 Main St', 'Acme', '2024-01-15', TRUE);

    The CREATE TABLE infers INTEGER, DATE (because the header contains 'date') and BOOLEAN from the first sample, and VARCHAR(255) elsewhere. The INSERT block uses standard SQL single-quoted strings with the canonical TRUE/FALSE booleans.

    JSON for an API fixture

    Input
    Data Type: Products · Count: 1 · Format: JSON
    Output
    [
      {
        "id": 1,
        "name": "Wireless Headphones",
        "category": "Audio",
        "price": 412.93,
        "description": "High-quality wireless headphones with advanced features",
        "inStock": true,
        "rating": 4.3,
        "imageUrl": "https://picsum.photos/400/300?random=0.42…"
      }
    ]

    Product names and categories come from fixed lists, price is a random float between 10 and 1010 with two decimals, rating is between 3.0 and 5.0 with one decimal, and the image URL points at picsum.photos so the fixture renders without bundling real assets.

    About this tool

    Every prototype needs data, and reaching for production data is rarely an option — it's personal, regulated, or simply doesn't exist yet. This generator produces realistic but synthetic test data for users, products, and companies, plus a fully customisable schema mode where you pick the field names and types yourself.

    Every row gets sensible defaults: a numeric id starting at 1, names drawn from common first/last combinations, a phone number in the standard +1-XXX-XXX-XXXX format, a US-style street address with a real city/state, and a date in ISO YYYY-MM-DD form. Pricing floats, ratings round to one decimal, booleans are weighted to be realistic (users are 80% active, products 90% in stock).

    Choose your output: JSON for an API response, CSV for spreadsheet imports or SQL inserts, SQL for direct loading into a relational database, or TypeScript for typed fixtures in unit tests. The SQL output even generates a CREATE TABLE statement from the data shape, so you can paste it straight into a migration. Everything runs locally — generated data is never sent to a server.

    How to use

    1. Pick a data type

      Choose Users (id, name, email, phone, address, company, joinDate, isActive), Products (id, name, category, price, description, inStock, rating, imageUrl), Companies (id, name, industry, website, employees, founded, headquarters, revenue) or Custom to define your own fields.

    2. Set the count and output format

      Enter the number of records (1–1000) and pick JSON, CSV, SQL or TypeScript as the output format.

    3. Click Generate

      The generator produces the data, formats it, and shows it in a syntax-highlighted panel with Copy and Download buttons.

    4. Use it

      Copy into your test fixtures, paste a SQL script into psql, save the CSV for spreadsheet imports, or import the TypeScript module directly from a unit test.

    Use cases

    Seeding a development database

    Pick Users or Products, generate 50 records in SQL, and run the script against a local Postgres to populate a CRUD demo with realistic data.

    Feeding UI mockups and Storybook

    Generate 25 product records in JSON and pipe them into your component's props so list views, pagination and empty states all have content to render against.

    Building typed test fixtures

    Generate the data in TypeScript format and import the exported array directly into a Jest or Vitest test — the inferred interface doubles as the type contract.

    Load-testing CSV imports

    Spin up thousands of records in CSV format and feed them to your import pipeline to benchmark parsing, validation and insertion performance.

    Output formats

    FormatWhat you get
    JSONPretty-printed array of records, ready to drop into fetch mocks
    CSVHeader row plus comma-separated records with quoted fields
    SQLCREATE TABLE inferred from the schema plus a multi-row INSERT
    TypeScriptTyped interface plus an exported const array of records

    SQL CREATE TABLE infers INTEGER / DECIMAL(10,2) / BOOLEAN / DATE from the first sample, and falls back to VARCHAR(255) for strings.

    Common mistakes

    Mistake:Treating the generated data as production data.

    Fix:The values are random — phones, addresses and emails aren't real, but they look real enough that you must scrub them before screenshots, demos or examples that could leak into customer-facing surfaces.

    Mistake:Editing the SQL output by hand to fix column types.

    Fix:The CREATE TABLE type inference looks at the first sample row. If you need a different schema, build a custom data type and set the field types explicitly instead of patching the generated DDL.

    Mistake:Forgetting that the random number generator isn't seeded.

    Fix:Two consecutive Generate clicks produce different rows. If you need stable fixtures for snapshot tests, copy the output into a fixture file rather than regenerating each run.

    Mistake:Using custom field names with special characters.

    Fix:Field names are emitted verbatim into JSON keys, CSV headers and SQL columns — anything other than letters, digits and underscore will break one of the three outputs.

    Frequently asked questions

    References & standards