Skip to content
cosmodev ~/tools/mock-data-generator

Trình tạo dữ liệu Mock

Generators

Tạo dữ liệu giả xác định được (tên, email, số, ngày, boolean, UUID, chọn từ danh sách) từ một schema và một seed. Kết quả tái tạo được.

Đầu ra · 5 hàng
[
  {
    "id": 0,
    "name": "Joaquin Smith",
    "email": "joaquin.smith@acme.io"
  },
  {
    "id": 1,
    "name": "Linnea Kowalski",
    "email": "linnea.kowalski@mail.com"
  },
  {
    "id": 2,
    "name": "Diego Henry",
    "email": "diego.henry@test.org"
  },
  {
    "id": 3,
    "name": "Caius Castillo",
    "email": "caius.castillo@test.org"
  },
  {
    "id": 4,
    "name": "Max Chavez",
    "email": "max.chavez@mail.com"
  }
]

Có seed: cùng lược đồ, số hàng và seed luôn cho kết quả giống hệt nhau. Các hàng nhất quán — email khớp với tên; thành phố, bang, mã bưu chính, điện thoại và đơn vị tiền tệ khớp với quốc gia.

(Tài liệu bằng tiếng Anh)

What it does

Generate deterministic fake data from a schema and a seed. Pick from 43 field types across eight categories: identity (name, email, username), contact (phone, avatar, password), location (country, city, state, postal, street, coordinates), commerce (company, job title, price, currency, product name, SKU), web (URL, slug, IPv4/IPv6, MAC, color, user agent), text (word, sentence, paragraph, headline, catchphrase), and numeric (integer, number, decimal, percentage, sequence, boolean), plus UUIDUUIDA 128-bit identifier generated to be practically unique without coordination, most commonly in version-4 (fully random) form., date, pick-from-list, string, and index. Rows are coherent: an email matches the name on its row, and the city, state, postal code, phone format, and currency all match the row’s country. Seeded, so the same schema, row count, and seed always produce identical output - perfect for fixtures and tests. 100% client-side.

How to use it

  1. Add fields: give each a name and pick a type from the grouped list (Identity, Contact, Location, Commerce, Web, Text, Numeric, Other).
  2. Set the type-specific options that appear (min/max, precision, length, charset, start/step, or pick options).
  3. Set the Rows count (1–500) and a Seed — hit New seed for a different random draw.
  4. The JSON renders live on the right, pinned while you scroll the schema.
  5. Copy it, or Download it as mock-data.json.

Examples

Schema id: index, name: fullName, email: email, 3 rows, seed 1 → a 3-element array with sequential ids and coherent names/emails (each email derives from its row’s name).

Schema country, city, postal, phone, 5 rows → every row’s city, postal format, and phone format match its country.

Good to know

  • Private: generation is local; data is synthetic, not real people.
  • Seeded and deterministic (mulberry32 PRNG) - not cryptographically random; UUIDs are v4-shaped.
  • Avatars are inline generated SVG identicons - no external requests.
  • Related tools: UUIDUUIDA 128-bit identifier generated to be practically unique without coordination, most commonly in version-4 (fully random) form. Generator, JSON to TypeScript.
Mã nguồn14 ngôn ngữ

100% phía client · dữ liệu của bạn không bao giờ rời khỏi trình duyệt. Thấy hữu ích? Chia sẻ với đồng nghiệp của bạn.