Qualification:
Cambridge Advanced Nationals in Computing (AAQ)
Certificate:
Computing: Application Development (H029 / H129)
Unit:
F161: Developing Application Software
2.1 - Data Formats & Types
Watch on YouTube:
Data Formats
Data Types
You need to know the characteristics, uses, advantages and disadvantages of six data formats (ASCII, Unicode, CSV, fixed-length, JSON and XML).
You also need to know the characteristics, uses, advantages and disadvantages of six data types (Boolean, character, date, integer, real and string).
What You Need to Know

Data Formats
ASCII
ASCII (American Standard Code for Information Interchange) is a character-encoding system that represents 256 characters using 8-bit (1 byte) binary codes, including English letters, numbers, punctuation and control characters. It is used for storing and transferring basic English text, such as simple text files and character-based data.
It is simple, requires little storage and is widely supported by different computer systems. However, it supports a limited range of characters, so it cannot represent most non-English alphabets, symbols or emojis.
Link, Ocarina of Time, 1998
Lamball, Palworld, 2024
This information can simply be stored as plain ASCII characters.
Unicode
Unicode is a character-encoding standard that can represent a very large range of characters and symbols from different languages. A common encoding is UTF-16, which uses 16 bits (two bytes) for 65,536 possible characters. It is typically used for websites, applications and documents that need to store multiple languages, symbols and emojis.
Unicode supports characters from many different languages and provides a consistent standard across different systems. However, some Unicode encodings can require more storage per character than ASCII, and incorrect encoding can cause characters to display incorrectly.
Link 🗡️ | Ocarina of Time ⏳ | 1998 🗓️
Lamball 🐑 | Palworld 👹 | 2024 🗓️
Similar to ASCII, but Unicode allows a much wider range of characters and symbols.
CSV
CSV (comma-separated values) is a plain-text, tabular format where each row represents a record and values are separated into columns, usually by commas. The first row often contains column names. It is used in storing and transferring tabular data, such as spreadsheets, datasets and data exported from databases.
CSV is simple, human-readable, lightweight and widely compatible, resulting in small files that are fast to process and can be opened by many applications. But, it has limited support for data types and complex/nested data, with no enforced structure or validation, meaning inconsistent formatting, missing values and encoding problems can occur.
Character,Game,Year
Link,Ocarina of Time,1998
Lamball,Palworld,2024
Each value is separated by a comma, with column headings on the first row.
Fixed Width
Fixed width is a text-based format where each field is allocated a fixed number of characters, so data always starts and ends at predetermined positions. It is used in legacy systems, financial systems and transferring structured records where fields need to remain in predictable positions.
Fixed width has a consistent and predictable structure, making fields easy for software to locate without needing separators. But it can waste storage space because fields must use their allocated width and changing the structure or allowing longer values can be difficult.
Character Game Year
Link Ocarina of Time 1998
Lamball Palworld 2024
Each field is given a set amount of space so that the values line up.
JSON
JSON (JavaScript Object Notation) is a lightweight, text-based and human-readable format that uses key-value pairs and can contain nested data. It is used when transferring structured data between applications, particularly web applications, servers and APIs.
JSON is lightweight, easy for humans to read and software to process, supports complex/nested data and works with many programming languages. It is simple to read/write, scalable and language-independent. But it can become difficult to read with large or deeply nested datasets, and syntax errors can prevent the data from being parsed correctly.
{
"character": "Link",
"game": "Ocarina of Time", "year": 1998
}
Data is stored using key-value pairs.
XML
XML (eXtensible Markup Language) is a text-based, human-readable format that uses custom tags and attributes to describe and structure data and supports hierarchical/nested data. It is used to store and transfer structured data between different applications and systems, including configuration files and data exchange.
XML is flexible, platform-independent and human-readable, with support for metadata and nested structures that allow complex data to be represented. However, XML can be verbose (uses lots of extra text/tags), increasing file size and processing requirements. Complex XML can be difficult to process and syntax errors such as unclosed tags can prevent data from being parsed.
<zelda>
<character>Link</character
<game>Ocarina of Time</game>
<year>1998</year>
</zelda>
Data is stored between descriptive opening and closing tags
Data Types
Character
A character stores a single letter (e.g. L), digit (e.g. 7) or symbol (e.g. @). It is used to store individual values such as initials, grades or single-letter codes.
It is suitable and storage-efficient when only one character needs to be stored, but can only store one character, so multiple characters require a string.
String
A string stores a sequence of characters, such as "Pokopia", "Nintendo Switch 2" or "2026". Strings store text-based information, such as names, addresses, usernames and descriptions.
They can store multiple characters and a wide variety of text, making it flexible for textual data. However, they usually require more storage than a single character, and numbers stored as strings cannot normally be used directly in mathematical calculations.
Integer
An integer stores whole numbers with no decimal places, including positive numbers, negative numbers and zero, e.g. -5, 0, 120. It is used to store values that are counted in whole numbers, such as quantity, lives remaining or number of users.
Integers require less storage and can be faster and more precise to process than real numbers when decimals aren't required. However, they cannot represent fractional or decimal values, making it unsuitable for values such as 3.5.
Real
A real (also known as a float) stores numbers that can contain a fractional/decimal part, such as 3.14, -2.5 or 10.0. it is used in storing measurements and calculations requiring decimal values, such as temperature, distance or speed.
Reals can represent a much wider range of numerical values than integers, including fractional values. However, they require more storage than an integer and some real numbers cannot be represented exactly, potentially causing small rounding errors.
Boolean
A Boolean stores one of two possible values, usually True or False. It is used in representing yes/no or on/off conditions, such as whether a user is logged in.
It requires little storage and is simple and efficient for making decisions in programs. But it can only represent two states, so it is unsuitable when more possible values are needed.
Date
The date data type stores a calendar date, typically containing a day, month and year, such as 21/11/1998. It is used to store dates of birth, appointment dates, deadlines and release dates.
it allows software to validate, compare, sort and perform calculations with dates. However, different date formats can cause confusion or compatibility problems. For example, 11/10/2026 could mean 11th October or 10th November.
Questo's Questions
2.1 - Data Formats & Types:
1. For each data format (ASCII, Unicode, CSV, fixed width, JSON and XML), describe its characteristics and give one typical use. [3 each]
2. Give two advantages and two disadvantages of each of the following data formats: CSV, fixed width, JSON and XML. [4 each]
3. Explain the difference between ASCII and Unicode, including an advantage and disadvantage of each. [5]
4. For each data type (Boolean, Character, Date, Integer, Real and String), describe its characteristics and give an example of data it could store. [2 each]
5. For a hospital database, explain why different data types and data formats would be suitable for storing different pieces of data. Be specific. [5]
Some older computers stored years using only two digits to save space. This contributed to the Y2K problem, where 00 could be interpreted as 1900 rather than 2000, leading organisations around the world to check and update their systems before the new millennium.
Did You Know?
