His first books were scientific philosophies; Physiological Aesthetics (1877) draws heavily on the aesthetic and biological theories of Charles Darwin and John Ruskin, and The Colour Sense (1879) attracted the notice of Herbert Spencer. In 1879 he began writing for the London Daily News and publishing magazine fiction, and most of his stories are contained in 4 volumes, the first being Strange Stories (1884). His first 2 novels, Philistia (1884) and Babylon (1885), were followed by many others.
He wrote more than 40 novels and story collections, including romances and adventure stories set in exotic settings, mystery novels, and a dystopian satire of British culture, presenting contemporary intellectual movements and social ideas in an accessible form. He also wrote 30 works of nonfiction: scientific essays, travel writings and books of naturalist philosophy, including The Evolution of the Idea of God (1897) and The Hand of God (1909).