Token
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
To understand your code, a program called a compiler or an interpreter will generally break it down into small pieces called tokens.
A token is a single unit of text that we use to break down text-based code or data into small meaningful chunks. Tokens can be words, numbers, punctuation, and more. From these tokens, we can analyze the code and understand its structure.
For example, in GDScript, if is a token, as is func, class, var, but also values like 13.8, "Hello!" or true.
Anything separated by a space, a set of parentheses, or a comma is a token.
For example, in the expressions below:
if health < 10:
health = health + 5Here are the tokens used:
if (keyword)health (identifier)< (less than operator)10 (literal number): (colon)health (identifier)= (equal operator)health (identifier)+ (add operator)5 (literal number)To make your code runnable, a compiler first scans your entire script files to identify all the tokens. This helps the compiler understand the structure and purpose of your code.
Don't stop here. Step-by-step tutorials are fun but they only take you so far.
Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…