Token

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Token

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 + 5

Here are the tokens used:

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.

Become an Indie Gamedev with GDQuest!

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.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!