The basic definition is Hydrocarbons are the compounds that contain hydrogen and carbon and their derivatives(alcohols,aldehydes..etc).
The hydrocarbon has an hierarchial series which has the formula CnH2n+2 for alkanes ,CnH2n for alkenes and CnH2n-2 for alkynes.
Series (alkanes)
C1-methane CH4
C2-ethane C2H6
..
Series(alkenes)
C2-ethene C2H4
C3 propene C3H6
..
Series(alkynes)
C2-ethyne C2H2
C3 propyne C3H4
..