Thousands of tools! Check out Online Tools – I have now added thousands of tools.

I often have to generate random UNIX timestamps so I created this simple online utility that does it for me. It lets you generate however many random POSIX times you need from a 64-bit time range. It works in the browser and is powered by alien technology from the future.

Random Unix Time Generator Options

Range and Count
Format and Repetitions
Print full calendar time after each Unix time.
If selected, the random time picker can select the same Unix time multiple times.
Timestamp Base

Random Unix Time Generator Examples (click to try!)

21st Century Timestamps
In this example, we generate 50 random POSIX timestamps from the 21st century. To do this, we set the range start time to the beginning of the century (equal to 2001-01-01 00:00:00) and the range end time to the last second of the century (equal to 2100-12-31 23:59:59). We separate the output integers by a semicolon and uncheck the "Allow Time to Repeat" option. With this option turned off, no repeated timestamps are allowed and each point in time can appear in the output just once.
2778969262; 3441215074; 3851070691; 3083863007; 2739966270; 2150832026; 3928672706; 4063842230; 2183940864; 4003408067; 4017133932; 2582071655; 3388338309; 4085543795; 1386976856; 2141214477; 1673730790; 1223411106; 3085174762; 2027793165; 1108063005; 1928292881; 3708219423; 1187472982; 1410100914; 1617439400; 3293203960; 3225995232; 1749279364; 1847168730; 1072423759; 1432851289; 3304870588; 1312866934; 2353095855; 2156996462; 1397875311; 4074067044; 3543568035; 2809368733; 3739483081; 3972136243; 4010869491; 1903904857; 3690251585; 2576026194; 3089624082; 3200901912; 2081743204; 3191239114
Start date and time. Format: YYYY-MM-DD HH:MM:SS.
End date and time. Format: YYYY-MM-DD HH:MM:SS.
How many random timestamps to generate?
Separate timestamps with this symbol. (Newline by default.)
Show Human Time
Allow Time to Repeat
Decimal Base
Jan 1 1970 to Jan 19 2038
In this example, we generate random Unix times from the entire signed 32-bit region. The signed 32-bit values range from 0 to 01111111…1, with 0 being Jan 1, 1970, and all-ones being Jan 19, 2038. We choose the binary base for the output and generate 12 random time values separated by the "\n" character.
1100000010010101100111011100011
1011110101010011010111100011010
1010110101000001000010011010000
1111001010000011000101011100010
1001101110101011010000011000100
1100101010110100010011110100011
1000111110111011101010011
1101010000110011100101100011100
101000111111001000100010000111
1100101101011110001110011100
1100000110111100101001010000
1100010111001011100010011000100
Start date and time. Format: YYYY-MM-DD HH:MM:SS.
End date and time. Format: YYYY-MM-DD HH:MM:SS.
How many random timestamps to generate?
Separate timestamps with this symbol. (Newline by default.)
Show Human Time
Allow Time to Repeat
Binary Base
Max Unix Time Range
As JavaScript's Date object uses 64-bits to store the time, the smallest possible date is -271821-04-20 00:00:00 (that's year 271,821 BC) and the biggest possible date is 275760-09-13 00:00:00. The extra 32 bits make the available timestamp interval hundreds of thousands of years longer. We set this maximum time range in the options and extract ten random Unix seconds from it, which we output together with human-friendly time.
-3969078365758 (-123806-11-29 23:44:02)
-1952374339938 (-59899-09-20 18:27:42)
193814575328 (8111-09-28 06:02:08)
-7859570563688 (-247090-02-15 02:31:52)
-656285484026 (-18827-02-21 04:39:34)
-640121063841 (-18315-05-15 09:22:39)
-4045418147344 (-126225-10-20 16:50:56)
2162812993179 (70506-10-25 18:59:39)
-4045973595913 (-126242-03-14 21:34:47)
-4018739172180 (-125379-03-24 03:17:00)
Start date and time. Format: YYYY-MM-DD HH:MM:SS.
End date and time. Format: YYYY-MM-DD HH:MM:SS.
How many random timestamps to generate?
Separate timestamps with this symbol. (Newline by default.)
Show Human Time
Allow Time to Repeat
Decimal Base

How Does This Random Unix Time Generator Work?

This random POSIX time generator works entirely in your browser and is written in JavaScript. It creates random timestamps that are seconds since 00:00:00 UTC on January 1, 1970. The timestamp range is specified in the options as start and end variables. To convert the range dates to Unix time, the program calls the Date.UTC(…) function with years, months, days, hours, minutes, seconds arguments that are extracted from these dates. To generate a random timestamp between the two Unix times start and end, it generates a random integer via the formula Math.floor(Math.random()*(end-start+1))+start. In total, it generates count timestamps. The generation is done via a simple for loop that runs from 1 to count (specified in options). If the repetition option is enabled, it checks if the current timestamp was already added to the times array. If it was, then it repeats the loop. Otherwise, it pushes the new timestamp to the array. If the "Show Human Time" option is enabled, it converts the timestamp to a date string through a new Date(timestamp) object and extracts years, months, days, hours, minutes, and seconds from the date object via the getUTCFullYear(), getUTCMonth(), getUTCDate(), getUTCHours(), getUTCMinutes(), getUTCSeconds() methods and appends the human readable time in "YYYY-MM-DD HH:MM:SS" format to the timestamp. Sometimes, the Epoch time needs to be converted to another base, such as binary or hexadecimal. When such conversion is needed, the BigNumber JavaScript library comes handy. By constructing a new big number object bigNum from a timestamp via bigNum = new BigNumber(timestamp), it can be easily converted to a number in the specified base via bigNum.toString(base). When the array times is filled with the necessary number of elements, the program turns it into a string by executing the times.join(separator) method and prints it to the screen.

Created by Browserling

This random unix time generator was created by me and my team at Browserling. Behind the scenes, it's actually powered by our web developer tools that are used by millions of people every month. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!

Secret message: If you love my tools, then I love you, too! Use coupon code TOOLLING to get a discount at my company.