The microhardness, H, and Young's modulus, E, of a polycrystalline diamond film and several amorphous diamondlike carbon (DLC) films were determined from force-displacement curves obtained using an ultralow-load microhardness instrument (UMIS-2000). Measurements were made at a constant loading rate of 3 mN/s, to a maximum applied force of 67 and 100 mN with contact force of 0.06 and 1.07 mN, respectively. The diamond film had a surface morphology typical of microwave plasma chemical vapor deposition films (crystallite size 0.5-3 mum), and the force-displacement curves showed nearly complete elastic behavior. The average values of hardness (80-100 GPa) and modulus (500-533 GPa) are comparable to those of natural (001) diamond reference standards (H = 56-102 GPa, E = 1050 GPa). The DLC films were prepared by low-energy ion-assisted unbalanced magnetron sputtering. By varying the bombarding ion energy, five films were prepared having different sp3/sp2 bonding ratios (3-6), optical gaps (1.2-1.6 eV), and hydrogen concentrations (4-20 at %). The force-displacement measurements are characterized by substantial elastic recovery, and individual films show a very narrow range of hardness and modulus values. It is found that high hardness and improved modulus in DLC films correlate with increasing ion energy, sp3/sp2 bonding ratio, and energy gap. Individual films have mean values of hardness and elastic modulus in the range 12-30 GPa and 62-213 GPa, respectively.