GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • JSON Generator
  • Help Ukraine!
  • Try the next version!
  • Feedback

This view

  • Original page
  • New address

GeezerVison is showing json-generator.com — JSON Generator – Tool for generating random data

Help

List of template tags

random

Returns random item from passed arguments list.

Usage

{{random([arg1], [arg2] ... [argN])}}

Returns

*
repeat

Specifies number of repeats of array item. Repeatable array must contains only two items: first is repeat tag, second is item that must be repeated. If no arguments is specified item will be repeated from 0 to 10 times. If min argument is specified, item will be repeated that many times. If both arguments are specified, item will be repeated in specified range of times.

Usage

{{repeat([min], [max])}}

Arguments

ParamTypeDetails
min (optional)NumberMinimum number in the range. Default is 0.
max (optional)NumberMaximum number in the range. Default is 10.

Returns

Number
index

Index of current cloned object starting from 0.

Usage

{{index([startFrom])}}

Arguments

ParamTypeDetails
startFrom (optional)NumberIndex will start from this value. Default is 0.

Returns

Number
integer

Random integer in specified range. Can be negative.

Usage

{{integer([min], [max], [format])}}

Arguments

ParamTypeDetails
min (optional)NumberMinimum number in the range. Default is 0.
max (optional)NumberMaximum number in the range. Default is 10.
format (optional)StringNumber format. For more info visit Numeral.js.

Returns

NumberString
floating

Random float in specified range. If min argument is float, generated number will be float too with same number of decimals. Can be negative.

Usage

{{floating([min], [max], [fixed], [format])}}

Arguments

ParamTypeDetails
min (optional)NumberMinimum number in the range. Default is 0.
max (optional)NumberMaximum number in the range. Default is 10.
fixed (optional)NumberNumber of decimals. Default is 4.
format (optional)StringNumber format. For more info visit Numeral.js.

Returns

NumberString
bool

Random boolean value.

Usage

{{bool()}}

Returns

Boolean
date

Random date in specified range.

Usage

{{date([min], [max], [format])}}

Arguments

ParamTypeDetails
min (optional)DateMinimum date in the range. Default is new Date(1970, 0, 1).
max (optional)DateMaximum date in the range. Default is new Date().
format (optional)StringDate format. For more info visit datef.

Returns

Number
lorem

Random Lorem Ipsum text.

Usage

{{lorem([count], [units])}}

Arguments

ParamTypeDetails
count (optional)NumberNumber of generated units. Default is 1.
units (optional)StringUnits type. Can be words, sentences, or paragraphs. Default is sentences.

Returns

String
objectId

MongoDB's globally unique identifier for objects.

Usage

{{objectId()}}

Returns

String
guid

Random globally unique identifier.

Usage

{{guid()}}

Returns

String
custom function

You can create your own function, that returns any value. this keyword contains current generated object so you can refer previous existing fields as shown in example.

Usage

function (tags, index) {
  // Your code 
}

Arguments

ParamTypeDetails
tagsObjectObject with generation methods which has same names as the tags.
indexNumberIndex of current cloned object starting from 0.

Returns

*
firstName

Random person name of both genders if no gender is specified.

Usage

{{firstName([gender])}}

Arguments

ParamTypeDetails
gender (optional)StringGender of person name. Can be male or female.

Returns

String
gender

Previously generated person gender. Must be after field, that contains firstName tag.

Usage

{{gender()}}

Returns

String
surname

Random person surname.

Usage

{{surname()}}

Returns

String
company

Random company name.

Usage

{{company()}}

Returns

String
email

Generates email based on firstName, surname and company that are called before of it.

Usage

{{email([random])}}

Arguments

ParamTypeDetails
random (optional)BooleanIf true, random email address will be generated. Default is false.

Returns

String
phone

Generates random phone number.

Usage

{{phone([format])}}

Arguments

ParamTypeDetails
format (optional)StringFormat string which contains x letters. Default is "(xxx) xxx-xxxx".

Returns

String
country

Random country name.

Usage

{{country()}}

Arguments

ParamTypeDetails
abbreviation (optional)BooleanIf passed returns country name abbreviation instead of full name.

Returns

String
countriesList

Returns a list of 205 unique countries instead of passed string.

Usage

{{countriesList()}}

Returns

Array
state

Random US state name.

Usage

{{state()}}

Arguments

ParamTypeDetails
abbreviation (optional)BooleanIf passed returns state name abbreviation instead of full name.

Returns

String
city

Random US city name.

Usage

{{city()}}

Returns

String
street

Random US street name.

Usage

{{street()}}

Returns

String

About

We've all faced the problem of lack of information in our app. All interfaces seem lifeless and empty. Debugging with no data is also not simple.

I think that each of us has at least once in their lives created a bunch of files with JSON data, but they were just one object propagated without unique fields. JSON Generator was created in order to help with this. It provides an opportunity generate any data and in any quantity. Edit template, click "Generate" and you're done.

If you have found a bug, you have a suggestion for improving the application or just want to thank me, click on "Feedback".

Usage

JSON Generator has a convenient syntax. You can specify JavaScript object for template that you see in the left box. It will be cloned in infinite depth. Fields can have any name and value, but it must be valid JavaScript. Values, which are strings, may contain one or more template tags. When you click "Generate" the data source object to be copied several times and the place of tags will be inserted random values.

You can copy the generated JSON to clipboard by clicking "Copy to clipboard". Also you can download generated file by clicking "Download" button. Generated JSON size appears at the top right of the field with the generated data.

You can choose indentation for the generated JSON from the drop-down list. It can has values of "Compact", 2, 3 and 4.

JSON Generator remembers your last template in localStorage. If you want to reset it, click "Reset" button to reset template and UI.

You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.