This Color by Hexadecimal Rainbow turns a familiar color-by-number activity into an introduction to digital color values. Children match the codes in a key with the labels on the rainbow, then choose a crayon, marker, or colored pencil for each section.
My kids enjoy pixel coloring activities, and this worksheet uses a similar idea: a written value represents a choice of color. Younger children can focus on careful matching. Older learners can investigate what the six characters in each code actually mean.

Table of Contents
What Kids Can Practice
The worksheet gives children a reason to read a label precisely, locate the matching entry in a key, and follow a repeatable procedure. It is an unplugged introduction to representing information. Completing the picture does not require typing a program or understanding every detail of the number system first.
Ask children to explain one match before coloring the whole page. Can they point to the code in the rainbow and find the identical code in the key? Can they describe how they checked all the characters? This makes the thinking visible instead of judging understanding only by how neatly the finished rainbow is colored.
The rainbow provides a familiar pattern, but the task is to use the written key. Invite children to check the labels even when they think they know which color comes next. That habit connects the activity with following data accurately rather than relying on an expected picture.
What Is a Hexadecimal Color Code?
A hex color code is one way to describe a color in CSS, the styling language used on websites. Hex is common, but websites can also use other color formats. This activity focuses on the six-digit form: #RRGGBB. The # introduces the value, followed by three pairs of hexadecimal digits.
Read the pairs from left to right: RR is red, GG is green, and BB is blue. Each pair gives a value from 00 to FF, corresponding to 0 through 255. You can find this notation in the W3C CSS color specification and MDN’s hex-color reference.
Hexadecimal is a base-16 number system. It uses the digits 0–9 and the letters A–F. The letters stand for values ten through fifteen: A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15. They are numerical symbols here, rather than the initials of color names.
For example, #FF0000 has the pairs FF | 00 | 00. The red value is at its maximum, while green and blue are zero. In #00FFFF, the red value is zero and the green and blue values are both at their maximum. That combination is aqua, also called cyan.
Read the Rainbow Color Key
These are the codes used on the printable. The final column shows the same channel values in ordinary decimal notation. Children who are beginning can use the color names and codes, while older learners can compare the three numerical values.
| Worksheet color | Hex code | Red, green, blue |
|---|---|---|
| Red | #FF0000 | 255, 0, 0 |
| Orange | #FFA500 | 255, 165, 0 |
| Yellow | #FFFF00 | 255, 255, 0 |
| Bright green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Indigo | #4B0082 | 75, 0, 130 |
| Purple | #800080 | 128, 0, 128 |
| White | #FFFFFF | 255, 255, 255 |
Notice that #00FF00 is the very bright green often called lime in CSS. The worksheet’s purple is #800080. Color names are convenient labels, but the numerical code specifies the particular value. A different purple or green can have a different code.
White, #FFFFFF, uses the maximum value in all three channels. On white paper, a white section can simply remain uncolored. Black would be #000000, with all three channels at zero, although black is not one of the coloring choices in this worksheet’s key.
How to Use the Hexadecimal Rainbow Worksheet
Print the worksheet in color so children can use its key, or keep the color key visible on a screen beside a black-and-white printout. Gather coloring tools and choose the closest available match for each swatch. A useful code-matching exercise does not depend on owning an exact shade of every pencil.
- Choose one code in the rainbow and read it carefully.
- Find the same six-character value in the color key.
- Check the pairs from left to right so similar-looking codes are not confused.
- Choose the matching coloring tool and fill the labeled section.
- Repeat for the other sections, checking the key each time.
- Review the completed picture against the labels before putting the materials away.
Model the first match by pointing to both labels. Then let the child take over the checking routine. If several children are working together, one can read the code while a partner finds it in the key. Switch roles so everyone has a chance to interpret the labels.

Why Screen Colors and Crayons Differ
RGB describes combinations of red, green, and blue components. Screens produce colors with light, so this is an additive color model. Mixing paint or layering crayons involves pigments and does not behave in exactly the same way. Red and green light can combine to make yellow; mixing red and green paint is a different process.
The printable is a paper representation of digital values. Its appearance can vary with the printer, paper, ink, display, and coloring materials. Use a close visual match for the art activity, while keeping the written codes exact. This separates a useful approximation on paper from the precision of a numerical label.
For the six-digit form, each channel has 256 possible values. That gives 256 × 256 × 256, or 16,777,216 combinations. This count describes the six-digit RGB representation; it is not a claim that every possible color format or every color visible to people is included.
Explore Hexadecimal Place Value
Older children can split a two-digit hexadecimal value into its two places. The first digit represents groups of sixteen and the second represents individual units. For 4B, calculate 4 × 16 + 11 = 75. For 82, calculate 8 × 16 + 2 = 130.
That explains the indigo entry: #4B0082 has red 75, green 0, and blue 130. In the orange entry, A5 means 10 × 16 + 5 = 165. Take one pair at a time rather than asking a beginner to convert an entire color value immediately.
You can turn the calculation into a matching task. Write a pair such as FF, 80, or 00 and ask a partner to find its decimal value. Then check the result together. The goal is to connect the positions with their values, rather than memorize a list of answers.
Check and Debug Your Color Matches
If a section does not match the key, compare the labels before changing the color. Did the child reverse a pair, skip a character, or select the entry beside the intended one? Find the first difference and explain it. An error can reveal which part of the matching routine needs more attention.
Some labels differ only in position. #FF0000 and #0000FF contain the same digits but place them in different channels, producing red and blue. Read the value as three ordered pairs so that position remains part of its meaning.
For a digital extension, enter one of the worksheet’s values into a drawing tool that accepts hex colors. Compare its swatch with the paper key. Change one pair, keep the other two fixed, and observe the result. Record both the old and new value so another person can repeat the comparison.
Download the Color by Hexadecimal Rainbow
The one-page printable includes the rainbow and its hex color key. Use it for a short matching activity, then return to the same page for a discussion of pairs, place value, or digital color. Choose the depth of explanation that suits the learner rather than requiring every extension in one sitting.
Try More Color and Coding Activities
For another picture using the same idea, try our Hexadecimal Color by Number Easter Eggs. Ask children to explain the shared process even though the picture changes: read the label, find the key, match the color, and check the result.
You can also make a small original color-key puzzle on separate paper. Choose three colors and their codes, draw a simple divided shape, and label each region. Trade the puzzle with a partner and check whether the instructions communicate the intended result. This adds a design task to the matching activity.
Hexadecimal Rainbow Questions
Does my child need programming experience for this worksheet?
No. A beginner can match the labels to the color key. The explanations of RGB pairs and hexadecimal place value are optional extensions for learners ready to explore the numbers.
Do uppercase and lowercase letters change a hex color?
No. Hex color values are case-insensitive: #FF0000 and #ff0000 describe the same color. Keep the digits and their order correct when comparing labels.
What should children do with #FFFFFF?
It represents white. On white paper, that section can remain uncolored. Check the label against the key so leaving it white is a deliberate choice.
Save this hexadecimal rainbow activity for later!

Meet Toni, the Maker Mom behind Our Family Code
Hey there, I’m Toni! I’m a software engineer and Maker Mom that finds my joy in unleashing my children’s curiosity by exploring STEAM concepts with my fantastic five!
When I’m not chasing toddlers or raising tweens, you can find me tearing things up and putting them back together over here at Our Family Code.
I am the owner and content creator of multiple educational websites designed to increase access to STEAM & STEM education with a focus on teaching computer science and coding to kids of all ages!














This is such an interesting idea for making coding fun for kids, it can help them to cement their knowledge. Thanks for sharing!