/ / Document vs Data vs Code: What Makes the 3 Different?

Document vs Data vs Code: What Makes the 3 Different?

Document containing code, letters, and numbers data

Document, data, and code are three essential words in computing.

“Document” is often used interchangeably with “data” — however, the two words have subtle differences.

Moreover, “code” is commonly used purely as a technical term — but it has significant similarities with data.

This article will explain the differences and similarities between a document, data, and code.

First up, document.

What is a document?

A document is a page used to contain text, or graphics, or both.

For instance, consider the image below:

A person is holding a white piece of paper containing text data and graphic data

The paper (with the text “phone a friend”) is a document because it contains some text and a drawing.


Papers are not the only type of documents.

Types of Documents

Digital pages and paper pages are the two main document types for holding data.

A digital page and a paper page

But you may ask: “Is data not equivalent to a document?” No. Not at all! — Let’s take a closer look at “data.”

What is Data?

Data is the content of a document.

In order words, the text and graphics on a page are the document’s data.

So, while a document is a container, data is the content of that container.

Document and data depicted with wooden boxes inside a container

Types of Data

The most common types of data are graphical, audio, and textual data.

Graphical data

Graphical data are the visual contents of a page, such as diagrams, charts, videos, and images.

Audio data

Audio data are the sound-recorded contents of a page, such as WAV, MP3, and AAC.

Textual data

Textual data are the written contents of a page, such as letters (e.g., A, B, C), numbers (e.g., 1, 2, 3), symbols (e.g., $, #, +), and codes (e.g., <input>, body { background: #A18A77; }, if (condition) { //execute code }).

But hang on a sec…

If a document is a page, and data is the content of a page, what then is a code? Let’s find out below.

What is a code?

A code is any language that computers can understand and process. In other words, code means “computer’s language.”

Types of codes

There are several code types, but the common ones are HTML, CSS, JavaScript, and Python.

In summary

📄 A document is a page for holding data.

📅 Data is the content of a document.

👩‍💻 Code is the data that computers understand.


Featured Image: Stayhome TODO list by Markus Spiske

Get Helpful Resources in Your Inbox

A CodeSweetly Digest

Similar Posts