Template

Result

Options for exporting generated JSON files





Generate JSON online

Generating JSON data is useful for a variety of applications in software development. JSON (JavaScript Object Notation) is a lightweight data interchange format that's easy for both humans to read and machines to parse. It is widely used for configuration files, data exchange between APIs, and as a format for structured data in databases. By generating JSON data, developers can streamline processes, ensure consistency in data formatting, and facilitate efficient data handling across different systems.

The tool on this page is designed to make the generation of JSON data straightforward and efficient (Finally, I’m trying ^^). With its user-friendly interface, you can quickly specify the desired format and generate data without the need for boring coding or external tools like ChatGPT. This is particularly useful when dealing with large volumes of data, as it eliminates the manual effort and potential for errors. Additionally, the tool imposes no limitations on the amount of data you can generate, making it a versatile solution for various data generation needs (The only limitation is what the browser allows and the fact that the code of this tool is imperfect…). Whether you need a few files or extensive datasets, this tool simplifies the process, saving you time and effort while providing flexibility and ease of use.

Documentation

choice

choice('string1', 'string2', 'string3', ...)
Returns one of the strings passed as parameters.

random

random(min, max)
Returns a random integer.

  • Min and max are optional.
  • Min defaults to 0.
  • Max defaults to 2^53 -1.

randomFloat

randomFloat(min, max, scale)
Returns a random float.

  • Min, max, and scale are optional.
  • Min defaults to 0.
  • Max defaults to 2^53 -1.
  • Scale defaults to 2.

randomBool

randomBool()
Returns a random boolean.

repeat

repeat(numberOfTimes, elementToRepeat)
Duplicates an element and returns the result in an array.
Example: repeat(5, firstname())

date

date(format, from, to)
Returns a random date.

  • From and To are optional.
  • From defaults to 1900-01-01.
  • To defaults to 2100-01-01.

Examples:

  • date('Y-m-d H:i:s') returns '2001-03-10 17:16:18'
  • date('F j, Y, g:i a') returns 'March 10, 2001, 5:16 pm'
  • date('m.d.y') returns '03.10.01'
  • date('j, n, Y') returns '10, 3, 2001'
  • date('Ymd') returns '20010310'
  • date('D M j G:i:s T Y') returns 'Sat Mar 10 17:16:18 MST 2001'

For more details: PHP Date Manual

Regular expression

regex(regularExpression)
Returns a random string that matches a given RegExp Javascript object.
Example: regex(/hello+ (world|to you)/) can return 'helloooooooo world' or 'helloo to you'.
Uses randexp.js (MIT License).

Call a JavaScript function

function () { ... }
Returns the result of the function. 'this' represents the JSON object where the function is located.

expression

expression(exp)
Returns a string containing values from other columns of the current object.
Example: {{firstname}}.{{lastname}}.yopmail.com

index

index(start)
Returns the index of the element.

  • Start is optional.
  • Defaults to 0.

firstname

firstname()
Returns a random firstname.

lastname

lastname()
Returns a random lastname.

country

country()
Returns a random country.

countryCode

countryCode()
Returns a random country code (two characters).

city

city()
Returns a random city.