onlinenumbertools logo

Random matrix generator

World's simplest number tool

Quickly generate random numeric matrices in your browser. To get your matrix, just specify the dimensions, number bounds and matrix type you need in the options below, and this utility will generate that matrix. Created by developers for developers.
announcement a new project!
Super exciting news! We just launched TECHURLS – simple and fun tech news reader. Check it out!
Types of Matrices
Elements fill the entire matrix.
Elements outside the diagonal are zeros.
Elements below the diagonal are zeros.
Elements above the diagonal are zeros.
Elements on both sides of the main diagonal are equal.
Size and Range
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Digits in fractional part.
Separators and Prettifying
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Random matrix generator tool What is a random matrix generator?
This is an online browser-based utility for generating matrices with random numbers as their elements. You can generate random matrices of any size, shape, and form. All you need to do is enter the number of rows and columns in the options above as well as set the lowest and highest possible numeric values for random elements. You can also choose elements to be either integer or decimal numbers with the given precision. There are several templates for generating special types of matrices – 1) you can fill the matrix with random numbers only diagonally and generate a random diagonal matrix, 2) you can fill the matrix with random numbers above the diagonal and generate a random right-triangular matrix, 3) you can fill the matrix with random numbers below the diagonal and generate a left-triangular triangular matrix, 4) you can fill the matrix symmetrically and generate a random symmetric matrix, and 5) you can fill all matrix elements completely randomly. You can also customize matrix row and column separator symbols and if they're a space and a newline, then you can use beautify matrix function that aligns all matrix numbers into neat columns. That's numberwang!
Random matrix generator examples Click to use
Random Six-by-six Matrix
In this example, we generate a matrix with whole random numbers as its elements and dimension 6x6. All elements belong to the range from -100 to 100 and fill the entire matrix. The matrix is also prettified so all numbers are aligned below each other.
27 78 61 89 -66 68 -66 18 -73 67 -97 29 65 72 76 -15 32 38 -3 -94 100 -23 -21 -21 17 -40 -71 27 29 -5 93 -13 48 -15 8 80
Required options
These options will be used automatically if you select this example.
Elements fill the entire matrix.
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Random Diagonal Matrix
This example fills a matrix with random numbers only on the diagonal. All other elements are zeros. This is done by selecting the diagonal matrix type in the options. The range of random values is 0-9, which means diagonal elements can be only 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
9 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0
Required options
These options will be used automatically if you select this example.
Elements outside the diagonal are zeros.
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Random Right Triangular Matrix
This example generates a random upper triangular matrix (also known as right triangular matrix). This matrix has numbers only in the area above the main diagonal. We generate a matrix of fractions from the range [-5, 5], with three digits in the fractional part. As this matrix is rectangular (6x4), there are two zero rows under the main diagonal.
3.292 -1.541 1.776 -0.769 0 1.656 -4.467 0.979 0 0 4.721 -4.582 0 0 0 4.122 0 0 0 0 0 0 0 0
Required options
These options will be used automatically if you select this example.
Elements below the diagonal are zeros.
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Digits in fractional part.
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Random Left Triangular Matrix
In this example, we generate a lower triangular matrix (also known as left triangular matrix) of size 6 by 6. In this case, all numbers above the main diagonal are zero. We don't use the prettify matrix option here but instead, we split all rows of the matrix by a comma.
8, 0, 0, 0, 0, 0 46, 41, 0, 0, 0, 0 25, 19, 15, 0, 0, 0 14, 45, 11, 10, 0, 0 6, 35, 39, 46, 36, 0 48, 37, 2, 30, 49, 18
Required options
These options will be used automatically if you select this example.
Elements above the diagonal are zeros.
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Random Negative Symmetric Matrix
This example creates a symmetric matrix, with random negative integers (from -10 to -1). A symmetric matrix has a property that element a_ij is equal to a_ji. Note that only a square matrix can be symmetrical, so we set the same number of rows and columns (equal to 4).
-1 -4 -3 -4 -4 -5 -2 -8 -3 -2 -7 -9 -4 -8 -9 -5
Required options
These options will be used automatically if you select this example.
Elements on both sides of the main diagonal are equal.
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Random Vector
This example generates a matrix that is actually just a random vector. The randomness range is very tight here with the minimum value equal to 0.1 and the maximal value equal to 0.2. We set the numeric precision equal to 5 digits and generate a column matrix with eight elements.
0.12439 0.15987 0.10011 0.12835 0.13184 0.11571 0.18000 0.11669
Required options
These options will be used automatically if you select this example.
Elements fill the entire matrix.
Number of rows.
Number of columns.
Smallest random number.
Biggest random number.
Digits in fractional part.
Place this symbol between matrix columns.
Place this symbol between matrix rows.
Align all matrix elements in elegant columns.
Pro tips Master online number tools
You can pass options to this tool using their codes as query arguments and it will automatically compute output. To get the code of an option, just hover over its icon. Here's how to type it in your browser's address bar. Click to try!
https://onlinenumbertools.com/random-number-matrix?&rows=6&columns=6&element-separator=%20&row-separator=%5Cn&range-start=-100&range-end=100&whole-nums=true®ular-matrix=true&prettify-matrix=true
All number tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly create a list of numbers in arithmetic series.
Quickly create a list of numbers in geometric series.
Quickly calculate the coefficients of the binomial expansion.
Quickly create a list of random numbers.
Quickly create a list of random primes from a specific interval.
Quickly create a matrix with random numbers as its elements.
Quickly create a random row or column vector.
Quickly exchange rows and columns of a matrix.
Quickly find the determinant of any square matrix.
Quickly calculate any number of digits of number π.
Quickly generate the specified number of Euler constant's digits.
Quickly generate numbers of say what you see sequence.
Quickly calculate numbers of Fibonacci sequence.
Quickly create a sequence of prime numbers.
Quickly check if the given number is a prime.
Quickly compute all prime factors of a number.
Quickly compute all divisors of a number.
Quickly create a list of increasing or decreasing integers.
Quickly create a sequence of even numbers.
Quickly create a sequence of odd numbers.
Quickly choose one or more numbers from a list of numbers.
Quickly sort numbers in ascending or descending order.
Quickly filter numbers according to certain criteria.
Quickly add up all the numbers in the given list and find their sum.
Coming soon These number tools are on the way
Generate Natural Numbers
Create a list of natural numbers.
Generate Rational Numbers
Create a list of rational numbers.
Generate Real Numbers
Create a sequence of real numbers.
Generate Complex Numbers
Create a list of complex numbers.
Generate Binary Numbers
Create a sequence of binary numbers.
Generate Powers of 2
Create a list of numbers that are powers of two.
Generate Powers of 10
Create a list of numbers that are powers of ten.
Generate Pairs of Numbers
Create a sequence of number pairs.
Create a Floating Point Number
Create a fp from the significand, base and exponent.