Hewlett attended Cambridge public schools and graduated from Cambridge High School. He then studied at Boston University School of Law, becoming its first black graduate in 1877. Hewlett practiced law in Boston from 1877 to 1880, then moved to Washington, DC. In 1883 he was admitted to the bar of the United States Court of Claims and the United States Supreme Court bar. In 1890 Hewlett was appointed a justice of the peace for the District of Columbia by President Benjamin Harrison. He was reappointed by presidents Cleveland, McKinley, and Theodore Roosevelt for a total of sixteen years of service. Justices of the peace presided over a "poor man's court," with jurisdiction limited to civil cases involving less than $300.00. Nevertheless, this was considered a prestigious appointment for a black attorney. In 1906, when the number of justices of the peace was reduced from ten to six, Hewlett was not reappointed by President Roosevelt. Some in the African American press argued that this was a political decision at the highest level, involving lobbying by national black leader Booker T. Washington in favor of Washington's other black justice of the peace, Robert Terrell. As a member of the Supreme Court bar, Hewlett was involved in ten cases as counsel or co-counsel, often joining appeals filed on behalf of black southern defendants. He recommended at least two other African American attorneys for admission to the bar, Noah W. Parden of Tennessee in 1906 and Shelby J. Davidson of Kentucky in 1912. Many of the cases with which Hewlett was associated were attempts to win a broad interpretation of the Reconstruction amendments to the Constitution by the Supreme Court by arguing that the civil rights of black defendants, especially the right to equal protection under the law, had been violated through the wilful exclusion of African Americans from juries and grand juries. In "Charley Smith v. State of Mississippi" 162 U.S. 592 (1896) and "John G. Gibson v. State of Mississippi" 162 U.S. 565 (1896), Hewlett worked with attorney Cornelius J. Jones to argue that convicted murderers Smith and Gibson had been denied juries of their peers because the juries were empaneled using voter rolls that excluded black citizens. Both cases were dismissed by the court for reasons of lack of jurisdiction; legal scholar R. Volney Riser notes that this may have stemmed from Jones' failure to provide sufficient evidence to interpret the motivations of the Mississippi courts. In "Brownfield v. North Carolina" 189 U.S. 426 (1903), Hewlett worked with attorneys J.L. Mitchell and W.J. Whipper in a case that made similar arguments, again seeking to overturn a murder conviction on the grounds that black jurors had been excluded due to their race or color.