The following is a list of some Hello, world! programs.

  • Hello, world! programs make the text “Hello, world!” appear on a computer screen.
  • It is usually the first program encountered when learning a programming language.
  • Otherwise, it’s a basic sanity check for an installation of a new programming language.
  • If “Hello World” does not run, one must not try to develop complex programs before fixing the issues with the installation.

AWK

BEGIN { print "Hello, world!" }

Bash

echo 'Hello, world!'

C

#include <stdio.h>

int main()
{
    printf("Hello, world!\n");
    return 0;
}

C++

#include <iostream>

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

CSS

/* Hello World in CSS */
body:before {
    content: "Hello World";
}

Go

package main

import "fmt"

func main() {
  fmt.Println("Hello, world!")
}

HTML

<!DOCTYPE html>
<html>
  <head>
    <title>Hello, World!</title>
  </head>
  <body>
    <h1>Hello, world!</h1>  
  </body>
</html>

JavaScript

JavaScript does not have native (built in) input or output routines. Instead it relies on the facilities provided by its host environment.

Using a standard Web browser’s document object

document.write('Hello, World!');

or with an alert, using a standard Web browser’s window object (window.alert)

alert('Hello, world!');

or, from the Mozilla command line implementation

print('Hello, world!');

or, from the Windows Script Host

WScript.Echo('Hello, world!');

or, from Apple Safari, or Google Chrome debug console

console.log('Hello, world!');

PowerShell

"Hello, world!"

or

Write-Host "Hello, world!"

or

echo "Hello, world!"

or

[System.Console]::WriteLine("Hello, world!")

Python

print("Hello, world!")

Rust

fn main() {
    println!("Hello, world!");
}

sed

sed -ne '1s/.*/Hello, world!/p'

SQL

CREATE TABLE message (text char(15));
INSERT INTO message (text) VALUES ('Hello, world!');
SELECT text FROM message;
DROP TABLE message;

Swift

print("Hello, world!")