Hello World in Solidity

This Solidity Hello World example shows beginners how to output the text Hello, World! using Solidity.

Hello World in Solidity

Copy and paste this Solidity Hello World example into your editor, compiler, terminal or runtime.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract HelloWorld {
  string public message = "Hello, World!";
}

About this Solidity example

Hello World programs are commonly used to confirm that a programming language environment is working correctly. This example gives you a simple starting point for Solidity.

Back to all Hello World examples

The History of Solidity

Solidity has an interesting history and continues to be used by developers, students and organisations around the world. The language was created to solve specific technical challenges and has evolved over time through new versions, tools and community contributions. Depending on the language, it may be used for business software, web applications, scientific computing, systems programming, education or specialist industries. Learning about the origins of Solidity helps provide context for how it is used today and why it remains relevant. Many people begin their journey with a Hello World in Solidity example because it provides a simple introduction to the syntax and structure of the language. From that first program, developers often progress to larger projects and gain a deeper understanding of programming concepts. Although technologies change, Solidity continues to be an important part of the software development landscape and remains a valuable language to learn.

What is Solidity used for today?

Solidity is used by developers, businesses, educational institutions and technology organisations around the world. Depending on the language, common use cases include web development, desktop software, automation, scientific computing, mobile applications, embedded systems, enterprise software and data processing. Understanding how Solidity is used in the real world helps learners connect a simple Hello World in Solidity example to practical development projects. As programmers gain experience they often move from basic output statements to working with variables, functions, classes, databases and APIs.

Why learn Solidity?

Learning Solidity can provide valuable insight into programming concepts, software design and problem solving. Every language has its own strengths, community and ecosystem. Some languages are known for simplicity and readability, while others are valued for performance, reliability or specialised industry use. Writing a Hello World in Solidity program is often the first milestone on a longer learning journey. By understanding the syntax, history and modern applications of Solidity, developers can build a strong foundation before moving on to more advanced topics and larger software projects.

Explore more Hello World examples

Continue learning with more beginner-friendly Hello World examples in other programming languages.