The -ing form of a verb used as a noun, as in “Swimming is fun,” is called a gerund.
A gerund looks like a present participle because both commonly end in -ing, but its job in the sentence is different. In “Swimming is fun,” the word “swimming” acts as the subject, a noun-like role. In “I enjoy swimming,” it functions as the object of the verb “enjoy.”
A present participle, by contrast, usually helps form a verb phrase or modifies a noun. In “They are swimming,” “swimming” is part of the progressive verb phrase. In “the swimming child,” it describes the child. The identical spelling makes gerunds and participles a frequent grammar mix-up.
The term comes from Latin grammar, where gerundivus referred to a verbal form with a sense of something needing to be done. English gerunds are especially versatile because they can behave partly like verbs by taking objects and partly like nouns by filling noun positions.