How to Use a Realistic Test Data Generator (Faker) in 5 Steps
Sep 16, 2026 · AI-assisted
Why fake data that looks fake causes real bugs
You've been there: you seed a dev database with user1@test.com, John Doe, and 123 Main St, then ship. QA signs off because the form accepts it. Two weeks later a real customer with a 47-character hyphenated surname and a + in their email hits a validation regex you never stress-tested. The fake data was too polite.
That's the gap a realistic test data generator built on faker.js closes. Instead of typing placeholders by hand, you describe the shape of your data once, and the generator produces thousands of rows that actually look like the messy real world — accents, long names, edge-case punctuation, plausible dates. This walkthrough uses Mock Data Generator, which runs faker.js entirely in your browser. Nothing is uploaded, nothing is sent to an external API, and there's no signup wall before you can generate a single row.
How to generate realistic test data in 5 steps
Step 1 — Build your schema
Open the Mock Data Generator and add one field per column you need. For each field, pick a type — name, email, address, date, and the rest of the available set. The free tier gives you 15 field types, which covers the usual suspects for a users table, an orders table, or a product catalog.
Name your fields exactly as your code expects them. If your API returns created_at and not createdAt, use created_at. Renaming columns after the fact is the single most common source of "why doesn't this import" headaches.
Step 2 — Decide how many rows you actually need
Set the row count. The free tier goes up to 20,000 rows, which is more than enough to expose pagination bugs, slow queries, and UI that breaks past page three. If you're testing a virtualized list or a bulk-import path, that ceiling is where you'll feel the limit.
A practical tip: generate a small batch first (50–100 rows), eyeball it, then scale up. Catching a wrong field type at 100 rows takes seconds; catching it at 20,000 means regenerating everything.
Step 3 — Generate
Hit generate. faker.js runs locally in your browser tab, so the whole thing is a client-side loop. That matters for two reasons. First, it's fast — no round trip per row. Second, and more importantly for anyone working under an NDA or with production-like schemas, your field names and structure never leave your machine. There's no server logging your schema, because there's no server involved.
Step 4 — Preview before you commit
Look at the preview table. Check the obvious things: are dates in a sane range, are emails well-formed, did any field come back empty when it shouldn't? This is also where you spot the subtle stuff — a "name" field that only ever produces single-token values won't test your two-column layout.
Step 5 — Export as JSON or CSV
Download the result as JSON or CSV. JSON slots straight into a seed script or a mock API response; CSV drops into a spreadsheet or a COPY command. Pick based on where the data is going, not on habit.
When you need more than the free tier
The free limits are honest ones: 20,000 rows and 15 field types. If your work regularly pushes past that, there's an optional one-time Pro upgrade at $14.99. It removes the row cap, opens up 30+ field types including locale data (useful when you're testing internationalization and need names and addresses that aren't all US-shaped), lets you save up to 20 schemas in IndexedDB so you're not rebuilding the same table every morning, and adds SQL INSERT and multi-format ZIP export. It's also ad-free.
If you only generate test data once a month, the free tier is genuinely enough. Don't upgrade out of habit.
The alternative: scripting faker.js yourself
Before reaching for any tool, it's worth knowing what the DIY version looks like. faker.js is an npm package, so you can install it and write a seed script:
npm install @faker-js/faker
import { faker } from '@faker-js/faker';
const users = Array.from({ length: 1000 }, () => ({
id: faker.string.uuid(),
name: faker.person.fullName(),
email: faker.internet.email(),
created_at: faker.date.past().toISOString(),
}));
console.log(JSON.stringify(users, null, 2));
Trade-offs, honestly: a script is reproducible and lives in your repo, which is great for CI. But it needs Node installed, a package.json, and a decision about whether to commit the generated output. Changing the schema means editing code, not clicking a field. And if a designer or PM wants 200 rows of sample data for a mockup, handing them a Node script is a worse experience than handing them a CSV.
The browser tool wins when the schema is still in flux, when a non-developer needs the data, or when you don't want test fixtures sitting in version control. The script wins when generation is part of an automated pipeline you run repeatedly.
Practical tips that save time later
- Generate edge cases on purpose. Realistic data is good, but deliberately weird data is better. If the generator lets you vary field types, mix in long strings and unusual characters so your validation actually gets exercised.
- Keep the schema, not just the output. Regenerating from a saved schema beats hand-editing a CSV when requirements shift.
- Match your real column names and types. A
datefield that exports as a string will break a strict database import. Know what your target expects. - Don't paste real customer data into any generator. The whole point of fake data is that it isn't real. If you're handling sensitive files elsewhere, the same instinct applies — see how our privacy page describes the browser-only approach.
- Check row counts against your actual test. 20,000 rows is plenty for most UI work but nothing for a load test. Know which one you're doing.
If you're also wrangling structured data around your test fixtures, the JSON to CSV converter handles the flattening side, and the Meta Generator is there when you need structured data for a page rather than a database.
FAQ
Is this a real faker.js implementation or just something that looks like it?
It runs faker.js locally in your browser tab. The same library you'd install via npm is doing the generation, just without the Node setup. That means the data shapes — names, emails, addresses, dates — follow faker's own rules rather than a hand-rolled random string generator.
Do I need to create an account to generate test data?
No. There's no signup step before you can build a schema and generate rows. You open the page, add fields, pick types, and generate. Accounts aren't part of the workflow at all.
What's the row limit on the free tier?
Free generation goes up to 20,000 rows with a set of 15 field types. If you routinely need more rows, locale-specific data, or saved schemas, there's an optional one-time Pro upgrade at $14.99 that lifts the row cap and adds 30+ field types, IndexedDB schema saving, and SQL INSERT plus multi-format ZIP export.
Can I export directly to a SQL INSERT statement?
SQL INSERT export is a Pro feature, alongside multi-format ZIP export. On the free tier you get JSON and CSV, which cover most seeding scripts and spreadsheet imports. If your workflow is database-first, that's the feature to weigh when deciding on Pro.
Is it safe to use with schemas that mirror production tables?
Yes, and that's a good reason to prefer it. Because faker.js runs client-side, your field names and structure aren't transmitted anywhere. There's no external API call carrying your schema. You still shouldn't paste real customer records in as a starting point — generate from a schema instead.
How does this compare to Mockaroo or similar SaaS generators?
The main practical differences are the signup requirement and where the data is processed. Browser-based generation means no account and no schema leaving your machine. SaaS generators often have richer collaboration and sharing features. If you're a solo developer or a small team generating fixtures locally, the browser route usually gets you there faster.