FillText.com

Introduction

FillText generates JSON datasets for testing or demonstration purposes.

Demos:

http://filltext.com/?rows=20&fname={firstName}&lname={lastName}
fname,lname,telephone,address,city,state,zip
id,email,username,password

AngularJS Example

jQuery Example

Vanilla JS Example

Tutorial

Plug-ins


Options

feature description example output
~ Concatenates two objects fullname={firstName}~{lastName} fullname:"John Smith"
key= description example output
rows required, limit 1000 rows=100 100 items
optional random flag rows=! 0-100 items
value returns the value for key name=John name:"John"
{firstName} returns a random first name fname={firstName} "fname":"Joe"
{lastName} returns a random surname lname={lastName} "lname":"Smith"
{business} returns a random surname company={business} "company":"Smith Industries"
{streetAddress} returns a random street address address={streetAddress} "address":"101 Sample Ln"
{city} returns a random city city={city} "city":"Hill Valley"
{usState|abbr} returns a random US state name or optionally the 2-letter abbreviation state={usState|abbr} "state":"IL"
    state={usState} "state":"Illinois"
{addressObject} returns a full address object address={addressObject} "address": {
"streetAddress": "1432 Aenean Ct",
"city": "Dayton",
"state": "CO",
"zip": "94840"
}
{zip} returns a random 5-digit zip code zip={zip} "zip":"12345"
{email} returns a random email address email={email} "email":"something@somewhere.com"
{ip} returns a random IPv4 address ip={ip} "ip":"153.123.15.1"
{username} returns a random username uname={username} "uname":"JSmith"
{password} returns a random password pwd={password} "pwd":"P88yg"
{ccType|abbr} returns a credit card type or optionally the abbreviation for that type ccType={ccType|abbr} "ccType":"AMEX"
    ccType={ccType} "ccType":"American Express"
    Available types AMEX, DISC, MC, VISA
{ccNumber|type} returns a valid credit card number for the optional type cc={ccNumber|DISC} "cc":"6011467129650052"
    cc={ccNumber} "cc":"4221275995626366"
{phone|format} returns a 10-digit telephone number, optionally formatted as (XXX)XXX-XXXX phone={phone} "phone":"1234567890"
    phone={phone|format} "phone":"(123)456-7890"
{index} returns the index of the current record id={index} "id":1
{date|min,max} returns a random date between the min and the max dates, the default is 1-1-1900 to 1-1-2100 x={date} "x":"1930-10-18T04:28:27.432Z"
    x={date|10-10-2010} "x":"2012-10-18T04:28:27.432Z"
    x={date|10-10-2010,10-12-2010} "x":"2010-10-11T04:28:27.432Z"
{lorem|n} returns a random lorem ipsum of n length, the default is 5 words={lorem} "words":"lorem ipsum dolor xoxoxo oooo"
    words={lorem|2} "words":"lorem ipsum"
pretty beautifies the JSON data pretty=true
callback wraps the JSON data in a callback function callback=cb cb(JSON DATA)
[x,y,z] sets value to random element from the array passed in category=[1,2,3,4] "category":2
    category=["x","y","z"] "category":"y"
{bool|n} returns a random true or false or the optional boolean passed as n active={bool} "active":true
    active={bool|false} "active":false
{string|n}
legacy function: {randomString|n}
returns a random string of n length, the default is 5 password={string} "password":"x1KQ5"
    password={string|8} "password":"p4TtyJ1c"
{number|max}
legacy function: {randomNumber|max}
returns a random integer up to the optional max, the default max is 10 id={number}} "id":8
    id={number|100}} "id":55
{numberLength|length}
legacy function: {randomNumberLength|length}
returns a random string of digits of up to the optional length, the default length is 5 id={numberLength} "id":12345
    id={numberLength|3}} "id":123
{numberRange|min, max} {randomNumberRange|MINtoMAX} returns a random integer between MIN and MAX, the deault is 0to1 id={randomNumberRange} "id":1
    id={randomNumberRange|5to50} "id":26
{randomDecimal|max} returns a random decimal up to 0.00000000000001 minus the optional max, the default max is 1 x={randomDecimal}} "x":0.14641021215356886
    x={randomDecimal|4}} "x":3.741405854932964
{randomDecimalRange|MINtoMAX} returns a random decimal between MIN and MAX, the deault is 0to1 x={randomDecimalRange} "x":0.14641021215356886
    x={randomDecimalRange|0.25to0.26} "x":0.25155138769885527
{stringArray|length,stringLength} returns a string array of the optional length containing randoms strings of the optional stringLength. The default is 5,5 x={stringArray} "x":["SGvuA","ditZd","S8rBF","YHgPd","jKYB0"]
    x={stringArray|2} "x":["SGvuA","ditZd"]
    x={stringArray|2,2} "x":["Sx","dI"]
delay delays the response up to a maximum of 30 seconds delay=10 Response is delayed by 10 seconds
errWill return an error of the specified type and override all other inputs, can be used without "rows"err=300returns "Multiple Choices"
  err=301returns "Moved Permanently"
  err=302returns "Found"
  err=303returns "See Other"
  err=304returns "Not Modified"
  err=305returns "Use Proxy"
  err=306returns "Switch Proxy"
  err=307returns "Temporary Redirect"
  err=308returns "Permanent Redirect"
  err=400returns "Bad Request"
  err=401returns "Unauthorized"
  err=402returns "Payment Required"
  err=403returns "Forbidden"
  err=404returns "Not Found"
  err=405returns "Method Not Allowed"
  err=406returns "Not Acceptable"
  err=407returns "Proxy Authentication Required"
  err=408returns "Request Timeout"
  err=409returns "Conflict"
  err=410returns "Gone"
  err=411returns "Length Required"
  err=412returns "Precondition Failed"
  err=413returns "Request Entity Too Large"
  err=414returns "Request-URI Too Long"
  err=415returns "Unsupported Media Type"
  err=416returns "Requested Range Not Satisfiable"
  err=417returns "Expectation Failed"
  err=418returns "I'm a teapot"
  err=422returns "Unprocessable Entity"
  err=423returns "Locked"
  err=424returns "Failed Dependency"
  err=425returns "Unordered Collection"
  err=426returns "Upgrade Required"
  err=449returns "Retry With"
  err=450returns "Blocked by Windows Parental Controls"
  err=451returns "Legally Restricted"
  err=500returns "Internal Server Error"
  err=501returns "Not Implemented"
  err=502returns "Bad Gateway"
  err=503returns "Service Unavailable"
  err=504returns "Gateway Timeout"
  err=505returns "HTTP Version Not Supported"
  err=506returns "Variant Also Negotiates"
  err=507returns "Insufficient Storage"
  err=509returns "Bandwidth Limit Exceeded"
  err=510returns "Not Extended"

Low Level Functions You'll Probably Never Use

feature description example output
{letter|n} returns a random string of any case letters of n length, the default is 5 password={letter} "password":"AbCdE"
{letterLower|n} returns a random string of lowercase letters of n length, the default is 5 password={letter} "password":"abcde"
{letterUpper|n} returns a random string of uppercase letters of n length, the default is 5 password={letter} "password":"ABCDE"
char returns a random Unicode character between 0 and 100 ?rows=3&c={char} [{"arr":"\u0006"},{"arr":"'"},{"arr":"/"}]

Advanced (and sometimes experi/\/\ental)

feature description example output
@key generates a nested JSON dataset rows=1&name={firstName}&@friends={rows=5} [{"name":"Sheldon","friends":[{},{},{},{}]}]
subset configuration requires * (asterisk) as a parameter delimiter rows=1&name={firstName}&@friends={rows=5*name={firstName}} [{"name":"Kendall","friends":[{"name":"David"},{"name":"Joann"},{"name":"Jerrod"},{"name":"Theresia"},{"name":"Leela"}]}]
Cannot currently render more than one level of nested data.
WILL NOT WORK: ?rows=1&fname={firstName}&@friends={rows=1*friendName={firstName}*@nestedFriends={rows=5}}
?gist generates JSON from a gist ?gist=2260cda3c59f6df8edef awesomesauce.