The best website background image size is 1920 x 1080 pixels and the ideal ratio is 16:9.
The dpi (dots per inch) should be at least 72, yet consider keeping the file size as small as possible to minimize site loading time
Warning: The incorrect image size can lead to pixelation, stretching, and other viewing issues.
To ensure that your image shows well in all browsers, spend some time testing it. If you use Chrome, for example, make sure the image also loads and displays properly when using Safari, Firefox, and Edge.
You should also view your background on a smartphone and tablet. This tutorial explains how to change the background image on the mobile.