The "Hello, World!" program is the first step for programmers to become acquainted with a new programming language. It's considered to be one of the simplest programs possible in almost all languages.

In this article, you'll learn how to write the "Hello, World!" program in the top 20 most popular programming languages.

What Is a “Hello, World!” Program?

A "Hello, World!" program is a computer program that outputs or displays the message "Hello, World!". This simple program is used to illustrate the basic syntax of a programming language. A "Hello, World!" program is often the first program written by beginners when introduced to a new language.

It's also used as a sanity test to make sure that a computer language is installed correctly. This is required because a lengthy and complex process is involved in configuring a programming language, therefore a simple program like "Hello, World!" is used as a first-run test on a new toolchain.

The following is a list of "Hello, world!" programs in the top 20 most popular programming languages.

1. "Hello, World!" Program in JavaScript

JavaScript is the world's most popular coding language. It's used both on the client-side and server-side and is called the programming language of the web.

Below is the "Hello, World!" program in JavaScript:

 <script>
console.log('Hello, World!');
</script>

Output:

 Hello, World! 

2. "Hello, World!" Program in Python

Python is also one of the most popular programming languages. It's used for web development, software development, mathematics, system scripting, etc.

Below is the "Hello, World!" program in Python:

 print("Hello, World!") 

Output:

 Hello, World! 

3. "Hello, World!" Program in Golang (Go)

Go is an open-source programming language developed by Google. Go provides many features like static typing, garbage collection, concurrency support, powerful standard library and toolset, testing capabilities, etc.

Below is the "Hello, World!" program in Golang (Go):

 package main
import "fmt"
 
func main() {
 fmt.Println("Hello, World!")
}

Output:

 Hello, World! 

4. "Hello, World!" Program in Java

Java is a high-level, class-based, and object-oriented programming language. Java is used in a variety of fields like mobile app development, desktop GUI applications, web-based applications, gaming applications, big data technologies, distributed applications, cloud-based applications, IoT applications, etc.

Below is the "Hello, World!" program in Java:

 class HelloWorld {
 
 public static void main(
 String args[])
 {
 System.out.println("Hello, World!");
 }
}

Output:

 Hello, World! 

5. "Hello, World!" Program in Kotlin

Kotlin is a cross-platform, statically typed, general-purpose coding language with type inference. Kotlin is primarily used for android development.

Below is the "Hello, World!" program in the Kotlin programming language:

 fun main(args: Array<String>) {
 println("Hello, World!")
}

Output:

 Hello, World! 

6. "Hello, World!" Program in PHP

PHP is an open-source scripting language. It's used to develop websites and web apps. It's so popular that about 79% of the websites are powered by PHP.

Related: How to Build Your First Simple PHP Website

Below is the "Hello, World!" program in PHP:

 <!DOCTYPE html>
<html>
<head>
  <title> </title>
</head>
<body>
 
<?php
echo "Hello, World!";
?>
 
</body>
</html>

Output:

 Hello, World! 

7. "Hello, World!" Program in C#

C# was developed by Microsoft in 2000. It's used to develop desktop applications, web applications, and web services. It's also used in game development.

Related: Practical Reasons to Learn C# Programming

Below is the "Hello, World!" program in C#:

 namespace HelloWorld
{
 class Hello {
 static void Main(string[] args)
 {
 System.Console.WriteLine("Hello, World!");
 }
 }
}

Output:

 Hello, World! 

8. "Hello, World!" Program in Swift

Swift was created by Apple in 2014. It's a general-purpose programming language for the Apple ecosystem. Most iOS games you play or apps you use are written in React Native or Swift.

Below is the "Hello, World!" program Swift:

 print("Hello, World!") 

Output:

 Hello, World! 

9. "Hello, World!" Program in C++

C++ is a general-purpose object-oriented programming language created by Bjarne Stroustrup. It's widely used to develop operating systems, browsers, games, etc.

Below is the "Hello, World!" program in the C++ programming language:

 #include <iostream>
using namespace std;

int main()
{
 cout << "Hello, World!";
 return 0;
}

Output:

 Hello, World!