
Coding Education
What Is a String in Programming: Text Data Type

Bayu Nugraha
Children's Coding Specialist

A string is a data type that stores text — a sequence of letters, numbers, spaces, or symbols written between quotation marks. For example, "Hello", "Player1", and "kids coding" are all strings. The computer treats a string as one chain of characters, not as a number it can do math with.
Table of Contents
- How Strings Work
- String vs Number: What's the Difference?
- Text String Meaning
- What Is a Number String
- Why It Matters for Kids
How Strings Work
Each character in a string is stored in order, and the computer counts positions starting from zero. The easiest way for a child to picture it is a player's name in a game. When a child types name = "Zara" in Python, the computer keeps the letters Z, a, r, a as a single string and can show it on screen with print("Hello " + name). In Scratch, the "say [Hello]" block also works with a string — the text inside the white box is the string.
One important fact: strings and numbers are different even when they look alike. "25" with quotes is a string (text), while 25 without quotes is a number you can add up. That is why "2" + "2" gives "22", not 4.
String vs Number: What's the Difference?
The difference between a string and a number is the quotation marks: "25" with quotes is a string, which is text, while 25 without quotes is a number the computer can do math with. They can look identical on screen yet behave in opposite ways. Add the numbers 2 + 2 and you get 4; join the strings "2" + "2" and you get "22", because joining text just sticks the characters together. This is why a phone number is usually stored as a string: you never add phone numbers up, and a string keeps any leading zero that a number would drop. Knowing which type you have saves a child from one of the most common beginner bugs.
Text String Meaning
A text string is another name for a string. The word "text" is added to make clear that the data consists of readable characters rather than binary or numeric data. In everyday programming, "string" and "text string" refer to the same thing: a sequence of characters stored between quotation marks. Whether a developer says "pass the string" or "pass the text string," they mean the same data type. Some languages use the label Text instead of String for this type (Haskell is one example), but the concept behind both names is identical.
What Is a Number String
In programming, a number string is a string that happens to contain only digits, such as "12345". It looks like a number but behaves like text: you cannot do arithmetic with it unless you convert it first. Phone numbers, postal codes, and ID numbers are typically stored as number strings because they need to keep leading zeros and are never added or multiplied.
In math education, "number string" has a different meaning: a sequence of related arithmetic problems designed to help children spot patterns and build mental calculation strategies. The two uses share a name but describe completely different things.
Why It Matters for Kids
Strings are one of the first concepts a child uses when building interactive programs — from greeting a player to showing a score. Understanding strings helps kids tell text data apart from number data, an essential foundation before learning variables and user input. In Algonova's coding course, children practice using strings through simple game and story projects.
Want to try? Join a free coding class and let your child build their first program.